-
Notifications
You must be signed in to change notification settings - Fork 68
Implement support for Forgejo releases and tags #903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Build failed. ✔️ pre-commit SUCCESS in 2m 48s |
bc9b078 to
9d5d9b6
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 39s |
lbarcziova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello and thanks for the contribution! Mostly the same comments as in #902 apply here, please ideally play with the code a bit locally e.g. by creating your own test repo in https://codeberg.org and once you verify the code works, let us know and we can review it. As for tests, we are using requre for recording the test responses and the contribution guide and the README can help.
ogr/services/forgejo/release.py
Outdated
| name: Optional[str] = None, | ||
| tag_name: Optional[str] = None, | ||
| ) -> "Release": | ||
| client = PyforgejoApi(api_url=project.forge_api_url, token=project.token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @pytest.fixture | ||
| def project(service): | ||
| repo = os.environ.get("FORGEJO_REPO", "existing_repo_name") | ||
| namespace = os.environ.get("FORGEJO_NAMESPACE", "existing_namespace") | ||
| project = service.get_project( | ||
| repo=repo, | ||
| namespace=namespace, | ||
| ) | ||
| if project is None: | ||
| pytest.skip(f"Project {namespace}/{repo} not found.") | ||
| return project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code has been updated in the meantime, can you please use the properties project or hello_world_project that were added and run the tests using those?
ogr/services/forgejo/release.py
Outdated
| api_url=self.project.forge_api_url, | ||
| token=self.project.token, | ||
| ) | ||
| # Assume the SDK provides a method to download the tarball. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next time please double-check the assumptions, this method doesn't exist 😄
and actually the save_archive method doesn't need to be implemented, it is implemented in the base.py, and checking the usage I don't see any, so we should maybe clean this up even
ogr/services/forgejo/release.py
Outdated
| return f"GitTag(name={self.name}, commit_sha={self.commit_sha})" | ||
|
|
||
|
|
||
| class ForgejoGitTag(GitTag): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the classes should inherit from the classes in abstract.py
Thank you so much for the feedback! 🙏🏽 I’ve gone through your comments and I really appreciate the guidance. I was able to do some local testing using a test repo on Codeberg as suggested and I’ve verified that the release creation works as expected. I'm looking forward to your review |
9d5d9b6 to
129f704
Compare
|
Build failed. ❌ pre-commit FAILURE in 3m 47s |
d055865 to
9566143
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 3m 44s |
ogr/services/forgejo/release.py
Outdated
| client = ForgejoRelease.get_api(project) | ||
| releases_data = client.get_releases(owner=project.owner, repo=project.repo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please provide a reference where did you get this from? This doesn't work for me and I don't see any method like that in the client repo..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. I just checked and it was my mistake
ogr/services/forgejo/release.py
Outdated
| """ | ||
|
|
||
| @cached_property | ||
| def api(self) -> PyforgejoApi: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be reusing the authenticated API client from the ForgejoProject class
Signed-off-by: Olamidepeterojo <[email protected]>
9566143 to
1dcd955
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 3m 41s |
|
Hello @lbarcziova, I would like your guidance in the section that has to do with "Outreachy internship project timeline" . |
|
Hi! Thanks a lot for the contribution, as this work became a priority for us, this was implemented in #927, therefore closing. |
TODO:
packit/packit.dev.Fixes #881
Related to #866
Merge before/after
RELEASE NOTES BEGIN
Packit now supports automatic ordering of ☕ after all checks pass.
RELEASE NOTES END