Skip to content

prowgen: allow ci-operator config to set private and expose#5127

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
Prucek:prowgen-private-expose
Apr 24, 2026
Merged

prowgen: allow ci-operator config to set private and expose#5127
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
Prucek:prowgen-private-expose

Conversation

@Prucek

@Prucek Prucek commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

Test plan

  • New test: "private job via ci-operator config" — fixture identical to existing .config.prowgen-based private test
  • New test: "private job with expose via ci-operator config" — verifies hidden is not set when expose is true
  • All existing tests pass (go test ./pkg/prowgen/...)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a configurable "private" flag to mark generated jobs as hidden from deck
    • Added an "expose" flag to allow showing jobs that are otherwise private
    • Private jobs now mount appropriate git credentials automatically when needed
  • Tests

    • Added test coverage and fixtures for private jobs with and without expose enabled

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bd26f814-1a56-4ef0-b4b9-27cefda15984

📥 Commits

Reviewing files that changed from the base of the PR and between a7cc63d and 3619cf1.

⛔ Files ignored due to path filters (1)
  • pkg/webreg/zz_generated.ci_operator_reference.go is excluded by !**/zz_generated*
📒 Files selected for processing (5)
  • pkg/api/types.go
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go
  • pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_via_ci_operator_config.yaml
  • pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_with_expose_via_ci_operator_config.yaml
✅ Files skipped from review due to trivial changes (2)
  • pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_via_ci_operator_config.yaml
  • pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_with_expose_via_ci_operator_config.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go

Walkthrough

Adds two optional booleans, private and expose, to ProwgenOverrides and makes the Prow job builder derive effective private/expose from ci-operator overrides (with fallback to job config), changing OAuth/GitHub credential mounting and deck visibility for generated jobs. Tests and fixtures exercise both combinations.

Changes

Cohort / File(s) Summary
Type Definition
pkg/api/types.go
Introduce Private bool and Expose bool fields on ProwgenOverrides (json:"private,omitempty", json:"expose,omitempty").
Builder Logic
pkg/prowgen/jobbase.go
Compute effective private and expose by preferring info.Config.* then falling back to configSpec.Prowgen.*; use these to decide OAuth token decoration, GitHub token volume inclusion, and whether to mark JobBase hidden.
Tests
pkg/prowgen/jobbase_test.go
Extend test case struct with *ciop.ProwgenOverrides and add two cases: private=true and private=true+expose=true to validate credential mounting and deck visibility behavior.
Fixtures
pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_via_ci_operator_config.yaml, pkg/prowgen/testdata/zz_fixture_TestProwJobBaseBuilder_private_job_with_expose_via_ci_operator_config.yaml
Add two YAML fixtures for decorated Kubernetes jobs that exercise private job behavior and the expose override, including volumes, mounts, serviceAccountName, and container specifications.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for private and expose fields in the prowgen configuration via ci-operator config.
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.
Stable And Deterministic Test Names ✅ Passed The PR uses Go's standard testing.T framework with table-driven tests, not Ginkgo. Test names added are stable, static strings that clearly describe test scenarios.
Test Structure And Quality ✅ Passed Custom check designed for Ginkgo test code, but PR uses standard Go testing with table-driven tests, not Ginkgo framework.
Microshift Test Compatibility ✅ Passed This pull request does not add any Ginkgo e2e tests. The custom check applies specifically to new Ginkgo e2e tests (It(), Describe(), Context(), When(), etc.), but this PR only modifies standard Go unit tests using the testing package. The test file imports confirm there are no Ginkgo or Gomega dependencies. Since no Ginkgo e2e tests are introduced, the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes consist of modifications to configuration types, builder logic, and standard Go unit tests, which are not e2e tests.
Topology-Aware Scheduling Compatibility ✅ Passed Configuration schema changes for ci-tools add Private and Expose fields without introducing problematic Kubernetes deployment manifests or controllers with scheduling constraints for SNO, Two-Node, or HyperShift topologies.
Ote Binary Stdout Contract ✅ Passed The PR modifies only data structures and builder logic in pkg/api/types.go and pkg/prowgen/jobbase.go, introducing no stdout writes or process-level code that would violate the OTE Binary Stdout Contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds standard Go unit tests with table-driven test cases and YAML golden files, not Ginkgo e2e tests.

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

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

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

@Prucek Prucek marked this pull request as draft April 23, 2026 12:11
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 23, 2026
@openshift-ci openshift-ci Bot requested review from deepsm007 and pruan-rht April 23, 2026 12:13
@openshift-ci openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 23, 2026
Add private and expose fields to the prowgen section of ci-operator
config. This allows repos to control job visibility directly in their
ci-operator config instead of requiring a .config.prowgen file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Prucek Prucek force-pushed the prowgen-private-expose branch from a7cc63d to 3619cf1 Compare April 24, 2026 07:19
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2026
@Prucek Prucek marked this pull request as ready for review April 24, 2026 07:19
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2026
@openshift-ci openshift-ci Bot requested a review from danilo-gemoli April 24, 2026 07:20
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

@Prucek: 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/breaking-changes 3619cf1 link false /test breaking-changes

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.

@danilo-gemoli

Copy link
Copy Markdown
Contributor

/lgtm

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

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danilo-gemoli, Prucek

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:
  • OWNERS [Prucek,danilo-gemoli]

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 8e2bfbf into openshift:main Apr 24, 2026
16 of 17 checks passed
Comment thread pkg/api/types.go
DisableRehearsals bool `json:"disable_rehearsals,omitempty"`
SkipOperatorPresubmits bool `json:"skip_operator_presubmits,omitempty"`
EnableSecretsStoreCSIDriver bool `json:"enable_secrets_store_csi_driver,omitempty"`
// Private indicates that generated jobs should be marked as hidden

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.

This not entirely true. We need this configuration to inject the oauth settings in the decoration config.

Prucek added a commit to Prucek/release that referenced this pull request Apr 27, 2026
Move private and expose settings from .config.prowgen files into
ci-operator config's prowgen section. This includes org-level configs:

- openshift-priv: private: true → added to 6393 ci-operator configs
- windup: private+expose → added to 7 ci-operator configs
- 45 repo-level .config.prowgen files migrated

Files with only private/expose are deleted. Files with additional
settings (slack_reporter, etc.) are kept with private/expose removed.

Depends on openshift/ci-tools#5127.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prucek added a commit to Prucek/release that referenced this pull request Apr 27, 2026
Move private and expose settings from .config.prowgen files into
ci-operator config's prowgen section. This includes org-level configs:

- openshift-priv: private: true → added to 6393 ci-operator configs
- windup: private+expose → added to 7 ci-operator configs
- 45 repo-level .config.prowgen files migrated

Files with only private/expose are deleted. Files with additional
settings (slack_reporter, etc.) are kept with private/expose removed.

Depends on openshift/ci-tools#5127.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
openshift-merge-bot Bot pushed a commit to openshift/release that referenced this pull request Apr 28, 2026
Move private and expose settings from .config.prowgen files into
ci-operator config's prowgen section. This includes org-level configs:

- openshift-priv: private: true → added to 6393 ci-operator configs
- windup: private+expose → added to 7 ci-operator configs
- 45 repo-level .config.prowgen files migrated

Files with only private/expose are deleted. Files with additional
settings (slack_reporter, etc.) are kept with private/expose removed.

Depends on openshift/ci-tools#5127.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Prucek added a commit to Prucek/release that referenced this pull request Apr 29, 2026
…78250)

Move private and expose settings from .config.prowgen files into
ci-operator config's prowgen section. This includes org-level configs:

- openshift-priv: private: true → added to 6393 ci-operator configs
- windup: private+expose → added to 7 ci-operator configs
- 45 repo-level .config.prowgen files migrated

Files with only private/expose are deleted. Files with additional
settings (slack_reporter, etc.) are kept with private/expose removed.

Depends on openshift/ci-tools#5127.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
BATMAN-JD pushed a commit to BATMAN-JD/release that referenced this pull request May 1, 2026
…78250)

Move private and expose settings from .config.prowgen files into
ci-operator config's prowgen section. This includes org-level configs:

- openshift-priv: private: true → added to 6393 ci-operator configs
- windup: private+expose → added to 7 ci-operator configs
- 45 repo-level .config.prowgen files migrated

Files with only private/expose are deleted. Files with additional
settings (slack_reporter, etc.) are kept with private/expose removed.

Depends on openshift/ci-tools#5127.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants