Skip to content

fix: auto-fill chaincode sequence with default value of 1 - #784

Merged
yeasy merged 26 commits into
hyperledger-cello:mainfrom
khanak0509:feature/chaincode-sequence-autofill
Jul 29, 2026
Merged

fix: auto-fill chaincode sequence with default value of 1#784
yeasy merged 26 commits into
hyperledger-cello:mainfrom
khanak0509:feature/chaincode-sequence-autofill

Conversation

@khanak0509

Copy link
Copy Markdown
Contributor

Fixes #769

When creating a chaincode, the sequence is always 1 for a brand new chaincode. There's no reason to ask users to manually type it every time - it just adds unnecessary friction and room for mistakes.
This PR removes the sequence input from the upload form in the dashboard and defaults it to 1
automatically across the backend.

changes -
•src/dashboard/src/pages/ChainCode/forms/UploadForm.js - removed the sequence
InputNumber field from the chaincode creation form

• src/api-engine/chaincode/models.py -added default=1 to the sequence field on the
Chaincode model

• src/api-engine/chaincode/serializers.py - marked sequence as not required and
defaulted to 1 in ChaincodeCreateBody

• src/agents/hyperledger-fabric/chaincode/serializers.py - same change in
ChaincodeCreationSerializer

Copilot AI review requested due to automatic review settings May 9, 2026 15:05
@khanak0509
khanak0509 force-pushed the feature/chaincode-sequence-autofill branch from ba81764 to 7571476 Compare May 9, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@yeasy
yeasy requested review from YoungHypo and dodo920306 May 10, 2026 17:13
YoungHypo and others added 18 commits May 10, 2026 23:17
…t Dockerfile

The agent Dockerfile hardcoded linux-amd64 for the Fabric binary download,
causing cryptogen to crash with SIGTRAP on ARM64 hosts (e.g., Apple Silicon).

- Use dpkg --print-architecture for reliable arch detection
- Fail build on unsupported architectures instead of silently defaulting to amd64
- Add curl --fail flag to catch HTTP errors early

Signed-off-by: haibo <haibo942us@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Some info of the postman collection is unnecessary for
the newman test, so they shouldn't be pushed on Git.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
The pipeline names can be more specific about their
actual purposes.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Rename workflow files according to their new action name.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
In order to use the latest docker (29+), Hyperledger Fabric
used in this project is bumped to 2.5.15

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Since the postman delay API only allows clients to delay
for at most 10 seconds, the expected 60 seconds delay
is unavailable. Thus, the maximum retry time is increased
from 5 to 30 to still keep waiting for 5 minutes for the
chaincode to be installed and approved.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
@khanak0509
khanak0509 force-pushed the feature/chaincode-sequence-autofill branch from 58f9d43 to 9adc1fe Compare May 10, 2026 17:47
@yeasy
yeasy requested a review from a team as a code owner July 17, 2026 21:53
Copilot AI review requested due to automatic review settings July 28, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@yeasy

yeasy commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Defaulting the sequence to 1 is reasonable for a brand-new chaincode, but this is not ready to merge yet:

Removing the sequence field from the dashboard prevents users from specifying 2, 3, etc. for chaincode upgrades. Fabric requires the sequence to be incremented for every definition update. Please either keep the field editable with a default value of 1, or derive the next sequence from the committed chaincode definition.

default=1 was added to the Django model without a corresponding migration. Please add an AlterField migration, or remove the model default if the serializer default is sufficient.

Please add tests covering omitted sequence → 1, an explicitly supplied sequence being preserved, invalid values being rejected, and the upgrade scenario.

Copilot AI review requested due to automatic review settings July 28, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@khanak0509

Copy link
Copy Markdown
Contributor Author

@yeasy Thanks for the review, I have addressed the requested change.

Signed-off-by: khanak0509 <kkhanak512@gmail.com>
@khanak0509
khanak0509 force-pushed the feature/chaincode-sequence-autofill branch from 7d43bb7 to bcc889b Compare July 28, 2026 22:56
@yeasy
yeasy merged commit cb40e86 into hyperledger-cello:main Jul 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Todo: Chaincode Sequence auto-fill

5 participants