Skip to content

Conversation

@sundaram123krishnan
Copy link
Contributor

@sundaram123krishnan sundaram123krishnan commented Jan 17, 2026

Fixes #3609

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds distgit and namespace to the source_json for dist-git builds, which is a useful enhancement. The logic change in builds_logic.py is correct and well-implemented. The accompanying test changes are also good, with an update to an existing test and the addition of a new one to cover the new functionality. My review includes a couple of suggestions for the test file: removing an unused import to keep the code clean, and improving the assertions in the new test to make it more comprehensive and robust, ensuring all relevant fields in source_json are verified. Overall, this is a good contribution. Addressing the suggested changes will further improve the quality of the tests.

Comment on lines +56 to +59
source_dict = json.loads(build.source_json)
assert "namespace" in source_dict
assert "distgit" in source_dict
assert source_dict["namespace"] == "forks/testuser"
assert source_dict["distgit"] == "fedora"

Choose a reason for hiding this comment

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

medium

The assertions in this test are not comprehensive. It's better to assert the entire source_json content to ensure all fields, including clone_url and committish, are correctly set. This makes the test more robust and consistent with test_copr_user_can_add_distgit_build.

Suggested change
source_dict = json.loads(build.source_json)
assert "namespace" in source_dict
assert "distgit" in source_dict
assert source_dict["namespace"] == "forks/testuser"
assert source_dict["distgit"] == "fedora"
expected_source_json = {
"clone_url": "https://src.fedoraproject.org/forks/testuser/rpms/mock",
"distgit": "fedora",
"namespace": "forks/testuser",
"committish": "master",
}
assert json.loads(build.source_json) == expected_source_json

@sundaram123krishnan sundaram123krishnan force-pushed the fix/store-distgit-in-source-json branch from c28d107 to 357cb26 Compare January 17, 2026 12:42
@sundaram123krishnan
Copy link
Contributor Author

sundaram123krishnan commented Jan 17, 2026

coprdb=# select source_json from build where id=44;
                                                         source_json
-----------------------------------------------------------------------------------------------------------------------------
 {"clone_url": "https://src.fedoraproject.org/forks/test_user/rpms/ed", "distgit": "fedora", "namespace": "forks/test_user"}
(1 row)

@github-actions
Copy link

Pull Request validation

Failed

🔴 Review - Missing review from a member (2 required)

Success

🟢 CI - All checks have passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build package by Dist-Git doesnt't store the dist-git source

1 participant