Skip to content

Update to make it work with Forge - #26

Merged
kpouget merged 9 commits into
openshift-psap:mainfrom
kpouget:update
Apr 10, 2026
Merged

kpouget merged 9 commits into
openshift-psap:mainfrom
kpouget:update

Conversation

@kpouget

@kpouget kpouget commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator
  • config: forge: images: rename the files for more consistency

  • README: update/fix the file locations

  • manifests: ocpci-sa: role: allow the OCPCI-SA to delete fjobs

  • manifests: ocpci-sa: rbac-wip-ns: add RBAC for OCPI-CI sa to access psap-automation-wip NS

  • hacks: copy-kubeconfig-secrets-to-ns: script to migrate the kubeconfig secrets to another namespace

  • config: forge: workflows/tasks: expose the ARTIFACT_DIR and FOURNOS_CI env vars

  • onfig: forge: workflows/tasks: use the long version of the bash safety options

and remove 'set -x'


  • config: forge: workflows/tasks: don't source the env file

not safe


Summary by CodeRabbit

  • Documentation

    • Updated onboarding/deployment commands and reordered the FORGE cluster setup workflow.
  • New Features

    • Added a utility to replicate kubeconfig secrets into a target namespace.
    • Added RBAC in the WIP automation namespace to permit cross-namespace job management (including delete).
  • Updates

    • Improved CI/task scripts: stricter shell error handling, explicit artifact setup, and CI mode flag.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@kpouget has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be4be563-3c84-4250-b851-ee837813f63d

📥 Commits

Reviewing files that changed from the base of the PR and between 6a34d35 and de9592c.

📒 Files selected for processing (8)
  • README.md
  • config/forge/images/build_forge-main.yaml
  • config/forge/images/buildrun_forge-main.yaml
  • config/forge/images/is_forge.yaml
  • config/forge/workflows/tasks.yaml
  • hacks/copy-kubeconfig-secrets-to-ns.sh
  • manifests/ocpci-sa/rbac-wip-ns.yaml
  • manifests/ocpci-sa/role.yaml
📝 Walkthrough

Walkthrough

Updated README deployment/onboarding commands and FORGE apply sequence; adjusted a Tekton Task step's shell options and environment setup; added a script to copy *-kubeconfig secrets between namespaces; added/updated Kubernetes RBAC Role(s) and a RoleBinding.

Changes

Cohort / File(s) Summary
Documentation & Workflow Manifests
README.md
Changed Kueue config path to config/kueue-config.yaml and replaced a directory-wide image/build apply with a multi-step sequence applying config/forge/images/is_forge.yaml, generating/applying config/forge/images/build_forge-main.yaml (namespace sed), creating buildrun_forge-main.yaml, then applying workflows.
Tekton Task
config/forge/workflows/tasks.yaml
Replaced set -euo pipefail/set -x with explicit set -o pipefail/errexit/nounset/errtrace; removed automatic forge_config.env export/source; conditionally extracts PULL_PULL_SHA, always runs git show --quiet, sets/exports ARTIFACT_DIR=/tmp/artifacts and FOURNOS_CI=true before exec bin/run_ci.
Utility Script
hacks/copy-kubeconfig-secrets-to-ns.sh
Added executable script to copy secrets matching *-kubeconfig from source namespace psap-automation to target namespace (arg or current project), strips runtime metadata with jq, and applies them to the target namespace.
RBAC
manifests/ocpci-sa/role.yaml, manifests/ocpci-sa/rbac-wip-ns.yaml
Added delete verb to Role for fournosjobs; added read-only pods/pods/log rules; introduced a new Role and RoleBinding in psap-automation-wip binding the ocpci ServiceAccount from psap-automation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • avasilevskii

Poem

🐰 I hopped through namespaces, secrets in tow,
sed'd a namespace and trimmed metadata low,
Shell flags tuned, artifacts tucked neat,
RBAC tied accounts so jobs can meet,
A rabbit cheers: builds bloom, swift and slow.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update to make it work with Forge' is overly vague and generic, using non-descriptive language that doesn't clearly convey the specific nature of the changes (configuration updates, RBAC adjustments, script additions, and workflow modifications). Revise the title to be more specific and descriptive, such as 'Update FORGE configuration, RBAC, and workflow tasks' or 'Add FORGE integration with config updates and RBAC permissions'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hacks/copy-kubeconfig-secrets-to-ns.sh`:
- Line 15: The loop over SECRET_NAME using `oc get secrets -n $SOURCE_NS -o name
| grep "\-kubeconfig"` will cause the script to abort under set -o pipefail and
errexit when grep finds no matches; modify the logic in
hacks/copy-kubeconfig-secrets-to-ns.sh to capture the grep output safely (e.g.,
assign the results of `oc get secrets ... | grep "\-kubeconfig"` to a variable
or array using `$(...)` or readarray and use `|| true`), then check if that
variable/array is empty and either print a clean message and skip processing (or
exit 0) when there are no matching secrets, and only iterate over SECRET_NAME
when non-empty; reference the loop variable SECRET_NAME and the `oc get secrets
-n $SOURCE_NS -o name` pipeline when making the change.
- Around line 20-28: The current pipeline uses oc create to write the
transformed secret into the target namespace (the oc get ... | oc create -n
"$TARGET_NS" -f - pipeline that references SECRET_NAME, SOURCE_NS, TARGET_NS),
which fails if the secret already exists; update that final command to use oc
apply -n "$TARGET_NS" -f - so the operation is idempotent (creates when missing,
updates when present) while keeping the existing jq deletions of metadata
fields.

In `@README.md`:
- Around line 199-201: The pipeline in the README uses separate commands that
aren't connected—ensure the YAML is streamed through sed into oc by piping cat
into sed and then into oc, and use sed with the variable substitution for
$FOURNOS_NAMESPACE and have oc read from stdin (e.g., via -f -); update the
commands around the cat/sed/oc sequence so sed receives the file input and oc
apply consumes the substituted YAML.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7c506150-ca30-40a6-b3b8-476146099a53

📥 Commits

Reviewing files that changed from the base of the PR and between 2ad1a30 and da1d808.

📒 Files selected for processing (8)
  • README.md
  • config/forge/images/build_forge-main.yaml
  • config/forge/images/buildrun_forge-main.yaml
  • config/forge/images/is_forge.yaml
  • config/forge/workflows/tasks.yaml
  • hacks/copy-kubeconfig-secrets-to-ns.sh
  • manifests/ocpci-sa/rbac-wip-ns.yaml
  • manifests/ocpci-sa/role.yaml

Comment thread hacks/copy-kubeconfig-secrets-to-ns.sh
Comment thread hacks/copy-kubeconfig-secrets-to-ns.sh Outdated
Comment thread README.md Outdated
@kpouget
kpouget force-pushed the update branch 2 times, most recently from e124f1e to 6a34d35 Compare April 10, 2026 12:10
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