Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Add config-as-code Secret template to Helm chart - #357

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
omer-vishlitzky:add-config-as-code-secret
Jun 18, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
omer-vishlitzky:add-config-as-code-secret

Conversation

@omer-vishlitzky

@omer-vishlitzky omer-vishlitzky commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds charts/aap/templates/config-as-code-secret.yaml — creates the config-as-code-ig Secret from Helm values
  • The secret contains AAP_EE_IMAGE, AAP_PROJECT_GIT_URI, AAP_PROJECT_GIT_BRANCH which prepare-fulfillment-service.sh reads to sync the AAP project
  • Guarded by configAsCode.eeImage being set — kustomize-path users (where the secret is created by secretGenerator) are unaffected
  • Adds eeImage, projectGitUri, projectGitBranch to charts/aap/values.yaml under configAsCode

Needed for the Helm-based CI deployment path (osac-project/osac-installer#296).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added Helm template for configuration-as-code secret management, enabling deployment of automation environment image and Git project configuration details through Kubernetes secrets.
    • Extended values configuration with new fields for environment image, project Git URI, and branch.

@openshift-ci
openshift-ci Bot requested review from eranco74 and rgolangh June 18, 2026 18:52
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@omer-vishlitzky, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 45 minutes and 9 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2956c528-ce31-49d8-8ab1-8b68bae16868

📥 Commits

Reviewing files that changed from the base of the PR and between 6f51b31 and 2160ec4.

📒 Files selected for processing (2)
  • charts/aap/templates/config-as-code-secret.yaml
  • charts/aap/values.yaml

Walkthrough

A new Helm template config-as-code-secret.yaml is added to the AAP chart. It conditionally renders a Kubernetes Secret with stringData fields for AAP_EE_IMAGE, AAP_PROJECT_GIT_URI, and AAP_PROJECT_GIT_BRANCH when .Values.configAsCode.eeImage is non-empty. Three corresponding fields (eeImage, projectGitUri, projectGitBranch) are added to values.yaml, each defaulting to an empty string.


Config-as-Code Secret

Layer / File(s) Summary
Values schema and Secret template
charts/aap/values.yaml, charts/aap/templates/config-as-code-secret.yaml
Three new configAsCode fields (eeImage, projectGitUri, projectGitBranch) are defined in values, and a conditional Secret template renders them as stringData entries gated on eeImage being set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


Poem

A secret is born when an image appears,
Git branch and URI whisper in ears.
Helm wraps them up with a conditional bow,
stringData fields in a neat little row.
🔐 Empty by default, but ready to grow!

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning AI tool usage (Claude Code) was mentioned in PR but commit uses Co-Authored-By trailer for AI, which should be flagged per check instructions. Repository patterns show Assisted-by is preferred. Replace Co-Authored-By trailer with Assisted-by: Claude Code noreply@anthropic.com in commit 6f51b31 to follow Red Hat attribution standards.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a Helm template for a config-as-code Secret resource with corresponding values entries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets found. Only Kubernetes Secret resource names (identifiers) and empty placeholder values are present; actual secret data is intended for runtime deployment configuration.
No-Weak-Crypto ✅ Passed PR adds a Helm Secret template for storing configuration values (image URI, Git URI, branch name). No weak crypto, custom crypto implementations, or insecure secret comparisons detected.
No-Injection-Vectors ✅ Passed No injection vectors detected. Environment variables are properly quoted using Helm's quote filter, and safe Ansible lookups with defaults handle consumption. No eval, shell=True, SQL concatenati...
Container-Privileges ✅ Passed No container privileges issues found. The PR adds only a Kubernetes Secret manifest and values file—neither contains container specs, privileged flags, host access settings, or capability escalations.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds a Secret template storing non-sensitive configuration (container image URI, Git repo URL, branch name). No logging/debugging of these values is introduced; template contains no echo/log...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/aap/values.yaml`:
- Around line 26-28: The default values for projectGitUri and projectGitBranch
are currently empty strings, which when configAsCode.eeImage is enabled, will
render empty environment variables AAP_PROJECT_GIT_URI and
AAP_PROJECT_GIT_BRANCH that override Ansible's intended fallback defaults.
Replace the empty string defaults for projectGitUri and projectGitBranch with
non-empty placeholder or fallback values that prevent these environment
variables from being set to empty strings in the generated Secret, ensuring
Ansible's default behavior is preserved when these values are not explicitly
configured.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b6b47a94-304c-43cb-a223-3fc5cd02e099

📥 Commits

Reviewing files that changed from the base of the PR and between 9034de1 and 6f51b31.

📒 Files selected for processing (2)
  • charts/aap/templates/config-as-code-secret.yaml
  • charts/aap/values.yaml

Comment thread charts/aap/values.yaml
Comment on lines +26 to +28
eeImage: ""
projectGitUri: ""
projectGitBranch: ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Set non-empty defaults for Git URI/branch to avoid overriding runtime defaults with empty env vars.

With current defaults, enabling configAsCode.eeImage can render a Secret that sets AAP_PROJECT_GIT_URI and AAP_PROJECT_GIT_BRANCH to empty strings, which may bypass Ansible’s intended fallback defaults and break project sync.

Suggested fix
 configAsCode:
   manifestSecret: "config-as-code-manifest-ig"
   secret: "config-as-code-ig"
   eeImage: ""
-  projectGitUri: ""
-  projectGitBranch: ""
+  projectGitUri: "https://github.com/osac-project/osac-aap.git"
+  projectGitBranch: "main"

Evidence: collections/ansible_collections/osac/config_as_code/playbooks/vars/config.yml:11-15 defines defaults for these env vars only when they are not set.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
eeImage: ""
projectGitUri: ""
projectGitBranch: ""
eeImage: ""
projectGitUri: "https://github.com/osac-project/osac-aap.git"
projectGitBranch: "main"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/aap/values.yaml` around lines 26 - 28, The default values for
projectGitUri and projectGitBranch are currently empty strings, which when
configAsCode.eeImage is enabled, will render empty environment variables
AAP_PROJECT_GIT_URI and AAP_PROJECT_GIT_BRANCH that override Ansible's intended
fallback defaults. Replace the empty string defaults for projectGitUri and
projectGitBranch with non-empty placeholder or fallback values that prevent
these environment variables from being set to empty strings in the generated
Secret, ensuring Ansible's default behavior is preserved when these values are
not explicitly configured.

Creates the config-as-code-ig Secret from values (eeImage,
projectGitUri, projectGitBranch) when eeImage is set. This secret
is consumed by prepare-fulfillment-service.sh to sync the AAP
project to the correct git branch.

Guarded by eeImage being set so kustomize-path users are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@omer-vishlitzky
omer-vishlitzky force-pushed the add-config-as-code-secret branch from 6f51b31 to 2160ec4 Compare June 18, 2026 19:06
@openshift-ci openshift-ci Bot removed the lgtm label Jun 18, 2026
@openshift-ci openshift-ci Bot added the lgtm label Jun 18, 2026
@openshift-ci

openshift-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand, omer-vishlitzky

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit d92092c into osac-project:main Jun 18, 2026
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants