Skip to content

NO-JIRA: Enforce no yarn.lock changes at build time#16107

Open
logonoff wants to merge 2 commits intoopenshift:mainfrom
logonoff:also-demo
Open

NO-JIRA: Enforce no yarn.lock changes at build time#16107
logonoff wants to merge 2 commits intoopenshift:mainfrom
logonoff:also-demo

Conversation

@logonoff
Copy link
Member

@logonoff logonoff commented Mar 4, 2026

Replaces openshift/release#75680

  • Replace custom git commands checking yarn.lock with --immutable flag which breaks at build time (instead of test time). The output is a lot prettier
  • Also run this in build-demos which means we will finally check for yarn.lock changes in demo plugin

Summary by CodeRabbit

  • Chores
    • Enhanced build dependency management with immutable install flag to ensure exact lockfile matching across environments.
    • Added validation checks for generated documentation and localization files to maintain consistency.
    • Added dependency cycle detection to prevent circular dependencies.
    • Removed demos test suite from the testing pipeline.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 4, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: This pull request explicitly references no jira issue.

Details

In response to this:

Replaces openshift/release#75680

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

This will cause builds to fail if yarnlock has changes
@openshift-ci openshift-ci bot requested review from rhamilto and spadgett March 4, 2026 16:25
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

This pull request modifies five shell scripts to enforce stricter dependency management and preflight validation. The build scripts add the --immutable flag to yarn install commands in both demos and frontend builds. The test suite changes include removing the demos test execution from the main test.sh flow, deleting yarn.lock validation from test-demos.sh, and consolidating preflight checks into test-frontend.sh. The new test-frontend.sh preflight validations include dynamic plugin SDK documentation state, i18n file state, yarn deduplication checks, and dependency cycle detection using yarn check-cycles, while replacing basic cd navigation with pushd/popd stack operations.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main objective: enforcing immutable yarn installs to prevent yarn.lock changes at build time across multiple build/test scripts.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@logonoff logonoff changed the title NO-JIRA: Merge test-demos and test-frontend NO-JIRA: Enforce no yarn.lock changes at buildtime Mar 4, 2026
@logonoff logonoff changed the title NO-JIRA: Enforce no yarn.lock changes at buildtime NO-JIRA: Enforce no yarn.lock changes at build time Mar 4, 2026
Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm

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.

🧹 Nitpick comments (1)
test-frontend.sh (1)

9-9: Balance pushd with guaranteed cleanup for explicit directory-stack handling.

Line 9 introduces pushd frontend without a matching popd. While this script executes standalone (never sourced), adding an explicit EXIT trap clarifies intent and improves robustness if this pattern is ever reused elsewhere.

♻️ Suggested refactor
-pushd frontend
+pushd frontend >/dev/null
+trap 'popd >/dev/null' EXIT
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test-frontend.sh` at line 9, The script uses pushd frontend without a
matching popd; add a guaranteed cleanup by registering a trap on EXIT that
performs popd to restore the directory stack. Locate the pushd frontend
invocation and add an EXIT trap (e.g., trap 'popd >/dev/null || true' EXIT)
before or immediately after pushd so popd always runs even on errors or early
exits; ensure the trap is idempotent and does not error if the directory stack
is empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test-frontend.sh`:
- Line 9: The script uses pushd frontend without a matching popd; add a
guaranteed cleanup by registering a trap on EXIT that performs popd to restore
the directory stack. Locate the pushd frontend invocation and add an EXIT trap
(e.g., trap 'popd >/dev/null || true' EXIT) before or immediately after pushd so
popd always runs even on errors or early exits; ensure the trap is idempotent
and does not error if the directory stack is empty.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4aaab250-b7d2-49c8-96c8-aca7023f8bec

📥 Commits

Reviewing files that changed from the base of the PR and between 78a64e0 and 481c911.

📒 Files selected for processing (5)
  • build-demos.sh
  • build-frontend.sh
  • test-demos.sh
  • test-frontend.sh
  • test.sh
💤 Files with no reviewable changes (2)
  • test.sh
  • test-demos.sh

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 4, 2026
@logonoff
Copy link
Member Author

logonoff commented Mar 4, 2026

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Mar 4, 2026
@logonoff
Copy link
Member Author

logonoff commented Mar 4, 2026

/label docs-approved

Tested locally that build will fail if yarn lock would have uncommitted changes
/verified by CI

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Mar 4, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 4, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/label docs-approved

Tested locally that build will fail if yarn lock would have uncomitted changes
/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@vojtechszocs
Copy link
Contributor

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, logonoff, vojtechszocs

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
Copy link
Contributor

openshift-ci bot commented Mar 5, 2026

@logonoff: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 481c911 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants