Skip to content

config/forge/resolve_job.yaml: sync with Forge Tasks - #104

Merged
kpouget merged 1 commit into
openshift-psap:mainfrom
kpouget:resolve
Jul 22, 2026
Merged

config/forge/resolve_job.yaml: sync with Forge Tasks#104
kpouget merged 1 commit into
openshift-psap:mainfrom
kpouget:resolve

Conversation

@kpouget

@kpouget kpouget commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

sync with https://github.com/openshift-psap/forge/blob/main/fournos/gitops/base/workflows/resolve-job.yaml

This should allow running jobs with PULL_NUMBER and no PULL_PULL_SHA, and use the HEAD commit of the PR

Summary by CodeRabbit

  • Bug Fixes
    • Improved artifact and log collection, including consolidated command output in run.log.
    • Improved checkout handling for pull request builds and fallback image commits.
    • Added more reliable target-cluster configuration, including clusterless execution support.
    • Improved environment variable setup and cleanup during job execution.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The resolve Job bootstrap script now configures workspace-based artifacts and logging, retrieves FournosJob settings, conditionally configures target-cluster access, resolves pull request or image commits, and receives FOURNOS_CI through container environment configuration.

Changes

Resolve Job bootstrap

Layer / File(s) Summary
Bootstrap, cluster setup, and source resolution
config/forge/resolve_job.yaml
The container script derives artifact paths from the workspace and step name, tees output to run.log, configures kubeconfig or CLUSTERLESS_MODE, extracts PULL_* variables, supports PR-number checkout, and delegates FOURNOS_CI configuration to the container environment.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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.
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.
Title check ✅ Passed The title clearly identifies the file and the main intent of syncing it with Forge Tasks.
✨ 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.

@albertoperdomo2

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2026
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: albertoperdomo2

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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2026
@kpouget
kpouget merged commit 3bd9f3b into openshift-psap:main Jul 22, 2026
3 of 4 checks passed
@kpouget
kpouget deleted the resolve branch July 22, 2026 15:46

@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

🧹 Nitpick comments (1)
config/forge/resolve_job.yaml (1)

46-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unquoted redirect target.

> $ARTIFACT_DIR/fournos_fjob.yaml should be quoted for consistency with the quoting used elsewhere in this script (e.g. Lines 51, 67).

🧹 Proposed fix
-              oc get "fjob/$FJOB_NAME" -n "$FOURNOS_WORKLOAD_NAMESPACE" -oyaml > $ARTIFACT_DIR/fournos_fjob.yaml
+              oc get "fjob/$FJOB_NAME" -n "$FOURNOS_WORKLOAD_NAMESPACE" -oyaml > "$ARTIFACT_DIR/fournos_fjob.yaml"
🤖 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 `@config/forge/resolve_job.yaml` at line 46, Quote the redirect target in the
oc get command, using the existing ARTIFACT_DIR variable and fournos_fjob.yaml
filename, to match the script’s other path handling.
🤖 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 `@config/forge/resolve_job.yaml`:
- Around line 38-39: Update the ARTIFACT_DIR assignment to use the declared
FOURNOS_STEP environment variable instead of the undefined FOURNOS_STEP_NAME,
preserving the existing artifact base directory and downstream artifact path
behavior under set -o nounset.
- Around line 89-97: Update the PULL_NUMBER branch’s PULL_PULL_SHA assignment to
run git rev-parse HEAD against "$FORGE_HOME", matching the existing fetch and
reset commands. Preserve exporting and logging the SHA from the updated PR
checkout.
- Around line 64-75: In export_env_var_from_fjob, separate the local declaration
of value from its command-substitution assignment so the cat/yq pipeline exit
status is preserved under errexit and pipefail. Keep the existing FournosJob
environment lookup and null-handling behavior unchanged.

---

Nitpick comments:
In `@config/forge/resolve_job.yaml`:
- Line 46: Quote the redirect target in the oc get command, using the existing
ARTIFACT_DIR variable and fournos_fjob.yaml filename, to match the script’s
other path handling.
🪄 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: 10ededd8-bb9e-48c2-bca2-aea5dfc33599

📥 Commits

Reviewing files that changed from the base of the PR and between 256f150 and de6d5b9.

📒 Files selected for processing (1)
  • config/forge/resolve_job.yaml

Comment thread config/forge/resolve_job.yaml
Comment thread config/forge/resolve_job.yaml
Comment thread config/forge/resolve_job.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants