Skip to content

chore: change behavior of filtered versions for restricted env.#1480

Merged
openshift-merge-bot[bot] merged 3 commits into
mainfrom
filtered-restricted-behav
Aug 7, 2025
Merged

chore: change behavior of filtered versions for restricted env.#1480
openshift-merge-bot[bot] merged 3 commits into
mainfrom
filtered-restricted-behav

Conversation

@zdrapela

@zdrapela zdrapela commented Aug 6, 2025

Copy link
Copy Markdown
Member

Description

Change the behavior of prepare-restricted-environment.sh script so that by default, no versions are filtered.

Also, for CI images (when using --ci-index), require to specify the version filter by --filter-versions flag. This option is used only for testing purposes, where you want to test one specific image.

Which issue(s) does this PR fix or relate to

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

Summary by Sourcery

Update prepare-restricted-environment.sh to disable default version filtering and enforce explicit version filter for CI index images

Enhancements:

  • Change default FILTERED_VERSIONS to '*' to include all operator versions by default
  • Require --filter-versions flag when --ci-index is true and exit with error if missing
  • Update script usage instructions to reflect new default behavior and CI requirement

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The prepare-restricted-environment.sh script now disables version filtering by default using a wildcard and enforces that CI index builds must explicitly specify a version filter; this is implemented by updating defaults, enhancing the help text and examples, introducing a flag-tracking variable, and adding a validation block.

File-Level Changes

Change Details Files
Default filtering behavior disabled
  • Set FILTERED_VERSIONS default array to '*' wildcard instead of specific versions
  • Adjust default CSV representation to reflect wildcard default
.rhdh/scripts/prepare-restricted-environment.sh
CLI help text and example updated
  • Add requirement note for --filter-versions when --ci-index=true in usage description
  • Update example invocation to include --filter-versions flag
.rhdh/scripts/prepare-restricted-environment.sh
Track presence of filter-versions flag
  • Introduce FILTER_VERSIONS_PROVIDED boolean variable
  • Set FILTER_VERSIONS_PROVIDED to true during --filter-versions parsing
.rhdh/scripts/prepare-restricted-environment.sh
Enforce version filter requirement for CI index
  • Add post-parse validation to error out if --ci-index=true without --filter-versions
  • Exit with an error message when validation fails
.rhdh/scripts/prepare-restricted-environment.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Comment thread .rhdh/scripts/prepare-restricted-environment.sh Fixed

@sourcery-ai sourcery-ai 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.

Hey @zdrapela - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-Authored-By: Fortune Ndlovu <fndlovu@redhat.com>
@openshift-ci openshift-ci Bot added the approved label Aug 7, 2025

@Fortune-Ndlovu Fortune-Ndlovu 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

@Fortune-Ndlovu

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 7, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Fortune-Ndlovu, gazarenkov

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 a82d3c0 into main Aug 7, 2025
9 checks passed
@openshift-merge-bot openshift-merge-bot Bot deleted the filtered-restricted-behav branch August 7, 2025 10:55
Fortune-Ndlovu added a commit to Fortune-Ndlovu/rhdh-operator that referenced this pull request Sep 6, 2025
…at-developer#1480)

* chore: change filtered versions for restricted env. behaviour

* Fix ShellCheck

* Resolve review comments

Co-Authored-By: Fortune Ndlovu <fndlovu@redhat.com>

---------

Co-authored-by: Fortune Ndlovu <fndlovu@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants