[bodhi2] Add script to make flatpak repos public #3412
No reviewers
Labels
No labels
ai-review-please
freeze-break-request
post-freeze
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/ansible!3412
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "zlopez/ansible:11543"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The repos created through docker push are created as private by default.
This script will run every hour and sets any private repo visibility to
public.
This should be next step to finish
infra/tickets#11543
Signed-off-by: Michal Konecny mkonecny@redhat.com
AI Code Review
Detailed Code Review
The implementation correctly targets the issue of repositories defaulting to private on push. However, there is a critical Jinja2 syntax error in the cron template that will prevent authentication from working properly. Additionally, the Python script lacks necessary safeguards against API failures and hanging network connections, which are important for scripts running unattended via cron.
📂 File Reviews
📄 `roles/bodhi2/backend/files/flatpak_quayio_repo_publisher.py` - A Python script that fetches private repositories from Quay.io and changes their visibility to public.
JSONDecodeErrorand crash the script unexpectedly.timeoutparameter. In an automated cron environment, a hanging network connection can cause the script to run indefinitely, potentially leading to overlapping executions and resource exhaustion.requests.getandrequests.postcalls.📄 `roles/bodhi2/backend/templates/flatpak_quayio_repo_publisher.cron.j2` - Jinja2 template defining the cron job for the publisher script.
{variable}for the OAuth tokens instead of Ansible's Jinja2 standard double curly braces{{ variable }}. This will result in the literal string '{bodhi2_quayio_oauth}' being passed to the script rather than the actual token.{}with{{ }}for variable evaluation.✅ Summary
flatpak_quayio_repo_publisher.cron.j2by using{{ }}instead of{}.get_private_reposproperly to preventJSONDecodeErrorexceptions during execution.requests.get()andrequests.post()in the Python script to prevent process hanging.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
c5f24b101f70db1df8bdAI Code Review
Detailed Code Review
The merge request implements a straightforward Python script and accompanying Ansible tasks to automate the visibility of Quay.io repositories. The logic for interacting with the Quay.io API is sound and handles pagination correctly.
However, there is a critical issue in the system cron job configuration. Files placed in
/etc/cron.d/require a username field before the command, which is currently missing. Without this, the cron daemon will fail to execute the script. Additionally, it is highly recommended to add basic timeout parameters to the network requests in the Python script to prevent the cron job from hanging indefinitely if the Quay API is unresponsive.📂 File Reviews
📄 `roles/bodhi2/backend/templates/flatpak_quayio_repo_publisher.cron.j2` - Adds a template for the cron job that runs the publisher script hourly.
/etc/cron.d/require a username field (e.g.,rootorbodhi) between the time specification and the command. Without it, cron will interpretQUAYIO_NAMESPACE...as the username and fail to execute.rootorbodhi) after the time schedule.📄 `roles/bodhi2/backend/files/flatpak_quayio_repo_publisher.py` - Python script to interact with the Quay.io API to fetch private repositories and change their visibility to public.
requests.getandrequests.postcalls are missing timeout arguments. In a cron job, if the remote server becomes unresponsive, the script will hang indefinitely instead of timing out, potentially leading to overlapping overlapping cron executions.requestscalls.✅ Summary
🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
70db1df8bd9bd7038f469bd7038f4605ac1a1e77