Skip to content

Conversation

@ramperher
Copy link
Contributor

@ramperher ramperher commented May 27, 2025

SUMMARY
  • To be able to test ZTP GitOps changes with dci-pipeline-check, we need to make sure that all branches from the reference repository are mirrored on Gitea firstly.
  • sg_repo_mirror_branch is not required anymore since we're going to mirror all branches
  • Deleting the tmp repository at the end of the mirror block, to make sure it's deleted
ISSUE TYPE
  • Enhanced Feature
Tests

Test-Hints: no-check

@ramperher ramperher requested a review from a team as a code owner May 27, 2025 10:53
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 27, 2025

📝 Walkthrough

Walkthrough

The Gitea setup role was updated to push all branches to the Gitea server instead of a single branch. The sg_repo_mirror_branch variable and its documentation were removed. The mirror push task now adds a remote and pushes all branches, and the temporary mirror directory cleanup was moved from cleanup tasks to the install tasks.

Changes

Files/Paths Change Summary
roles/setup_gitea/README.md Removed documentation for the sg_repo_mirror_branch variable.
roles/setup_gitea/defaults/main.yml Removed the sg_repo_mirror_branch default variable.
roles/setup_gitea/tasks/install.yml Changed mirror push to add remote and push all branches; added cleanup of mirror temp dir after push.
roles/setup_gitea/tasks/cleanup.yml Removed task that cleared the mirror temp directory.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ramperher ramperher force-pushed the gitea_mirror_all_branches branch from 1777098 to deca425 Compare May 27, 2025 10:54
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

@ramperher
Copy link
Contributor Author

cc @fredericlepied

@softwarefactory-project-zuul
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
roles/setup_gitea/tasks/install.yml (1)

164-168: ⚠️ Potential issue

Avoid exposing credentials in the command and hard-coded paths
Passing user credentials directly in the URL can leak secrets (even with no_log) and pinning /usr/bin/git may not work on all hosts. Consider:

  • Using Ansible’s git module with credentials handled via a credential helper or netrc.
  • Removing the absolute path so it picks up git from the environment’s PATH.
  • Letting failures surface (remove changed_when: false) and use failed_when to catch errors.

Let me know if you’d like a secure pattern example for credentials and error handling.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3da8829 and deca425.

📒 Files selected for processing (3)
  • roles/setup_gitea/README.md (0 hunks)
  • roles/setup_gitea/defaults/main.yml (0 hunks)
  • roles/setup_gitea/tasks/install.yml (1 hunks)
💤 Files with no reviewable changes (2)
  • roles/setup_gitea/defaults/main.yml
  • roles/setup_gitea/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Sanity Check (stable-2.17)

@ramperher ramperher force-pushed the gitea_mirror_all_branches branch from deca425 to 17b91ca Compare May 27, 2025 13:59
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

@softwarefactory-project-zuul
Copy link

@ramperher ramperher force-pushed the gitea_mirror_all_branches branch from 17b91ca to 6adabdf Compare May 27, 2025 14:10
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented May 27, 2025

from change #690:

  • no check (not a code change)

@softwarefactory-project-zuul
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
roles/setup_gitea/tasks/install.yml (1)

172-176: Ensure cleanup always runs even on failures
The mirror temp directory is removed only after a successful push. If the push fails, the cleanup task will be skipped, leaving stray directories. Wrap the mirror‐clone/push steps in a block with an always section to guarantee cleanup:

- block:
    # clone, remote add, push tasks…
  always:
    - name: Clean mirror temp dir
      ansible.builtin.file:
        path: "{{ _sg_mirror_repo.path }}"
        state: absent
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17b91ca and 6adabdf.

📒 Files selected for processing (4)
  • roles/setup_gitea/README.md (0 hunks)
  • roles/setup_gitea/defaults/main.yml (0 hunks)
  • roles/setup_gitea/tasks/cleanup.yml (0 hunks)
  • roles/setup_gitea/tasks/install.yml (1 hunks)
💤 Files with no reviewable changes (3)
  • roles/setup_gitea/defaults/main.yml
  • roles/setup_gitea/tasks/cleanup.yml
  • roles/setup_gitea/README.md
🔇 Additional comments (1)
roles/setup_gitea/tasks/install.yml (1)

158-158: Verify correct branch used for mirror clone
The clone task now uses version: "{{ sg_repo_branch }}". Ensure sg_repo_branch accurately reflects the reference repository’s default branch and is always set when sg_repo_mirror_url is provided.

@ramperher
Copy link
Contributor Author

This is ready for review

@fredericlepied
Copy link
Contributor

retest

@dcibot
Copy link
Collaborator

dcibot commented May 28, 2025

from change #690:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented May 28, 2025

from change #690:

  • no check (not a code change)

@ramperher ramperher added this pull request to the merge queue May 28, 2025
Merged via the queue into main with commit 2d12927 May 28, 2025
8 checks passed
@ramperher ramperher deleted the gitea_mirror_all_branches branch May 28, 2025 13:12
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.

4 participants