Skip to content

[ci] Use OCIR for non-release PRs - #1226

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
feat/use-ocir-for-prs
Jul 21, 2025
Merged

[ci] Use OCIR for non-release PRs#1226
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
feat/use-ocir-for-prs

Conversation

@lllamnyp

@lllamnyp Timofei Larkin (lllamnyp) commented Jul 21, 2025

Copy link
Copy Markdown
Member

Changing the container registry from GHCR to OCIR will help with more flexibe image retention policies and removes the restrictions on the GitHub token when contributors submit PRs from forks. Release PRs remain on GHCR, as before.

What this PR does

Release note

[ci] Use OCIR for non-release PRs

Summary by CodeRabbit

  • Chores
    • Updated workflow to use Oracle Cloud Infrastructure Registry (OCIR) for Docker authentication instead of GitHub Container Registry.
    • Improved environment variable handling to allow overriding the default Docker registry setting.

@coderabbitai

coderabbitai Bot commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the Docker registry configuration for CI workflows and Makefile scripts. The workflow now authenticates with Oracle Cloud Infrastructure Registry (OCIR) using new secrets, and a registry environment variable is added. In the Makefile, the registry variable assignment is made conditional, allowing for overrides.

Changes

File(s) Change Summary
.github/workflows/pull-requests.yaml Added REGISTRY env variable; switched Docker login from GHCR to OCIR with new secrets/values.
scripts/common-envs.mk Changed REGISTRY assignment from unconditional (:=) to conditional (?=).

Estimated code review effort

2 (10–30 minutes)

Poem

The registry’s changed, a new home to seek,
OCIR now welcomes our Docker technique.
Secrets are shuffled, the login is new,
The Makefile’s registry is flexible too!
With paws on the keyboard, I code and I cheer—
A hop and a skip, our builds persevere!
🐇


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello Timofei Larkin (@lllamnyp), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the CI/CD pipeline's robustness and flexibility by transitioning the default container image registry for non-release builds from GHCR to OCIR. This strategic move aims to alleviate common pain points such as restrictive GitHub token policies for fork-based contributions and to enable more adaptable image retention strategies. Furthermore, the changes introduce a mechanism to dynamically specify the target registry during the build process, improving overall build system configurability.

Highlights

  • Container Registry Migration: The default container registry for non-release pull requests has been shifted from GitHub Container Registry (GHCR) to Oracle Cloud Infrastructure Registry (OCIR). This change is intended to provide more flexible image retention policies and remove restrictions related to GitHub tokens when contributors submit PRs from forks.
  • Build System Flexibility: The REGISTRY variable in the scripts/common-envs.mk Makefile has been updated to use the ?= operator. This allows the default registry to be overridden externally, providing greater flexibility for CI/CD processes and local development environments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown
Contributor

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 switches the container registry to OCIR for non-release PR builds. The change to scripts/common-envs.mk correctly implements this. However, the PR also includes a change to packages/core/installer/values.yaml which updates the default installer image to one from OCIR. This change should be reverted, as the default configuration should point to a stable release image from GHCR.

Comment thread packages/core/installer/values.yaml Outdated
@@ -1,2 +1,2 @@
cozystack:
image: ghcr.io/cozystack/cozystack/installer:v0.34.0-beta.2@sha256:92639050dc388167c0a7047edc3288423963ecb36954e5cd1f472841bf380713
image: iad.ocir.io/idyksih5sir9/cozystack/installer:v0.34.0-beta.2@sha256:76f2c535d0222760805163b5e29410e0a17a3ccb5bce0c57a04a42e53af4987c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The change to values.yaml updates the default installer image to one from OCIR. This should be reverted because the default configuration in the repository should point to a stable, long-lived release image from GHCR, not a potentially temporary image from a PR build on OCIR, which could be subject to garbage collection.

  image: ghcr.io/cozystack/cozystack/installer:v0.34.0-beta.2@sha256:92639050dc388167c0a7047edc3288423963ecb36954e5cd1f472841bf380713

Changing the container registry from GHCR to OCIR will help with more
flexibe image retention policies and removes the restrictions on the
GitHub token when contributors submit PRs from forks. Release PRs remain
on GHCR, as before.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/pull-requests.yaml (1)

35-42: Consider updating the step name to reflect OCIR usage.

The step name "Login to GitHub Container Registry" is misleading since it now authenticates with Oracle Cloud Infrastructure Registry.

-      - name: Login to GitHub Container Registry
+      - name: Login to Container Registry

Or for more specificity:

-      - name: Login to GitHub Container Registry
+      - name: Login to Oracle Cloud Infrastructure Registry
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 71f7a88 and 6576624.

📒 Files selected for processing (2)
  • .github/workflows/pull-requests.yaml (2 hunks)
  • scripts/common-envs.mk (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
scripts/common-envs.mk (3)

Learnt from: NickVolynkin
PR: #1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the readme-generator tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Learnt from: NickVolynkin
PR: #1117
File: packages/apps/mysql/Makefile:8-8
Timestamp: 2025-06-26T04:29:24.830Z
Learning: The cozystack project uses yq v4+ on their CI runner, so yq v4 syntax (-o json --indent 4) is compatible and version checks are not needed.

Learnt from: NickVolynkin
PR: #1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (3)
scripts/common-envs.mk (1)

1-1: LGTM: Conditional registry assignment enables flexible registry switching.

The change from unconditional (:=) to conditional (?=) assignment correctly allows the GitHub workflow to override the registry value while maintaining GHCR as the default fallback. This implementation aligns perfectly with the PR objective to switch between registries based on the build context.

.github/workflows/pull-requests.yaml (2)

3-4: LGTM: Environment variable correctly enables registry override.

The addition of the REGISTRY environment variable set to ${{ secrets.OCIR_REPO }} properly integrates with the conditional assignment in scripts/common-envs.mk. This allows the workflow to override the default GHCR registry with OCIR for non-release PRs.


38-40: Verify OCIR credentials and registry configuration

Please double-check the following after switching from GitHub’s default registry to OCIR:

  • Ensure ${{ secrets.OCIR_USER }} and ${{ secrets.OCIR_TOKEN }} are defined under Settings → Secrets in this repository.
  • The iad.ocir.io endpoint must match your OCI region (e.g. iad.ocir.io for US-East, phx.ocir.io for Phoenix, etc.).
  • If you intend to push into a specific OCIR namespace (tenancy/compartment), you’ll need an OCIR_REPO secret and to inject it as your REGISTRY or in the with: block of build-push-action. Remove OCIR_REPO if it’s not used.
  • Verify that the docker/login-action step and the subsequent docker/build-push-action can successfully authenticate against OCIR and push your images.

Example snippet to wire up a custom namespace:

- name: Log in to OCIR
  uses: docker/login-action@v2
  with:
    registry: iad.ocir.io
    username: ${{ secrets.OCIR_USER }}
    password: ${{ secrets.OCIR_TOKEN }}

- name: Build and push
  uses: docker/build-push-action@v3
  env:
    REGISTRY: ${{ secrets.OCIR_REPO }}  # e.g. iad.ocir.io/tenancy/compartment
  with:
    context: .
    push: true
    tags: ${{ env.REGISTRY }}/my-image:${{ github.sha }}

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kvaps
Andrei Kvapil (kvaps) merged commit 25f1cb6 into main Jul 21, 2025
18 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the feat/use-ocir-for-prs branch July 21, 2025 14:21
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.

2 participants