Skip to content

The Refactor#735

Open
dodo920306 wants to merge 121 commits intohyperledger-cello:mainfrom
dodo920306:task/the-refactoring
Open

The Refactor#735
dodo920306 wants to merge 121 commits intohyperledger-cello:mainfrom
dodo920306:task/the-refactoring

Conversation

@dodo920306
Copy link
Contributor

Let's face it: the current state of this project’s code is not so good.

Contributions over time have lacked consistency, leading to duplicated implementations and a fragmented structure that makes maintenance and development difficult.

The combination of Python, Django, and object-oriented design has introduced unnecessary complexity, and without long-term technical stewardship, the project has become hard to extend.

Another pressing issue is the number of long-standing bugs. For a project that has been in existence for over six years, there remain issues that ideally should have been addressed very early on. Many of these are not superficial problems that tools or automated testing could easily detect, but deeper logical flaws that only become evident when the affected code paths are used.

Additionally, it seems that the project has not fully embraced the design principles of Django REST Framework (DRF). For example, serializers are often used only for traffic handling, while much of the core business logic resides in views.py, which goes against DRF’s intended design practices.

To summary, a refactor is inevitable, and to make sure I’m not just another person who criticizes without acting, I’ll do it myself.

@dodo920306 dodo920306 closed this Aug 29, 2025
@dodo920306 dodo920306 deleted the task/the-refactoring branch August 29, 2025 11:22
@dodo920306 dodo920306 restored the task/the-refactoring branch August 29, 2025 11:22
@dodo920306 dodo920306 reopened this Aug 29, 2025
@dodo920306 dodo920306 force-pushed the task/the-refactoring branch from b2553e7 to 4a3123e Compare October 6, 2025 07:52
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: KIRIN.CHU 朱祐麟 <KIRIN.CHU@deltaww.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Save TLS certificates in the DB so that they can
be accessed by other organizations in the future.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
1. Remove Chaincode peers input from the form
2. Sync Node status with status returned by the Docker Python API
3. Remove Channel peers/orders input from the form

Signed-off-by: dodo920306 <dodo920306@gmail.com>
Response chaincode status (CREATED, INSTALLED, APPROVED,
COMMITTED) for the chaincode page.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
@dodo920306 dodo920306 changed the base branch from lab/kirin-refactor to main February 21, 2026 00:40
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
@dodo920306 dodo920306 marked this pull request as ready for review February 21, 2026 01:13
@dodo920306
Copy link
Contributor Author

@yeasy Here is the latest update. I've reintroduced the agents as discussed, and all Hyperledger Fabric operations have now been consolidated within them.

This change inevitably increased the scope of the PR. Ideally, some of this restructuring could have been split into a follow-up PR, but given the current context, I've consolidated everything here to keep the refactor coherent.

At this stage, I believe the branch is in a mergeable state. While there is still room for improvement, those refinements can be addressed incrementally in subsequent PRs.

Since this branch is already significantly ahead of main (118 commits), I think it would be healthier for the project to bring main up to date with the refactor, rather than continuing to extend a long-running branch. Keeping branches aligned will make future development and review cycles much smoother.

If reviewing the full diff is challenging due to its size, I suggest focusing on the resulting architecture and overall behavior. I'm of course happy to clarify any specific concerns.

Given the above, I've updated the target branch to main. If you feel there's a strong reason to follow a different merge strategy, I'm open to discussing it.

Overall, I believe this PR is ready to move forward.

@yeasy
Copy link
Contributor

yeasy commented Feb 21, 2026

It will be better to have stable code before merging into main.
We need more test cases. can you help enhance the testing?

@dodo920306
Copy link
Contributor Author

It will be better to have stable code before merging into main. We need more test cases. can you help enhance the testing?

I can try, but I’d like to point out that doing so within this PR will further increase its scope and complexity.

@yeasy
Copy link
Contributor

yeasy commented Feb 23, 2026

Another approach is that checkout a new v1-stable branch and merge your refactor into main.
How do you think?
@dodo920306

@dodo920306
Copy link
Contributor Author

Another approach is that checkout a new v1-stable branch and merge your refactor into main. How do you think? @dodo920306

That's actaully a good idea! We can check out a release/1.2 branch from f9d56cf (tag v1.2.0).

Replace `make` with `docker compose` commands with
`docker-compose.dev.yaml` as the config file.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
@yeasy
Copy link
Contributor

yeasy commented Feb 24, 2026

Another approach is that checkout a new v1-stable branch and merge your refactor into main. How do you think? @dodo920306

That's actaully a good idea! We can check out a release/1.2 branch from f9d56cf (tag v1.2.0).

@YoungHypo how do you think?

@YoungHypo
Copy link
Member

Another approach is that checkout a new v1-stable branch and merge your refactor into main. How do you think? @dodo920306

That's actaully a good idea! We can check out a release/1.2 branch from f9d56cf (tag v1.2.0).

@YoungHypo how do you think?

LGTM.

@YoungHypo YoungHypo requested a review from Copilot February 28, 2026 02:24
@yeasy yeasy requested review from yeasy and removed request for Copilot February 28, 2026 02:27
yeasy
yeasy previously approved these changes Feb 28, 2026
In the Hyperledger Fabric docker agent, I want to igore files starting
with '.' like `.venv` for the python virtual environment for personal
development. Thus, I added `.*` in the `.dockerignore`. However,
this causes a warning when building the docker image because for
`COPY . .` because the current path `.` is also included in `.*`.
Therefore, `!.` is added to the dockerfile to suppress the warning.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
The Hyperledger Fabric agent in the CI pipeline aren't assigned with
the network and the docker socket volume, so it becomes inaccessible.

Signed-off-by: dodo920306 <dodo920306@gmail.com>
@dodo920306
Copy link
Contributor Author

dodo920306 commented Mar 1, 2026

@yeasy Here is a public demo video for this PR (with English subtitles).
https://youtu.be/4RJQRKVo9CQ

@dodo920306 dodo920306 requested a review from yeasy March 3, 2026 22:59
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.

3 participants