Skip to content

Make BigQuery optional for local development - #801

Open
JoelSpeed wants to merge 1 commit into
openshift:mainfrom
JoelSpeed:allow-disable-jira-locally
Open

Make BigQuery optional for local development#801
JoelSpeed wants to merge 1 commit into
openshift:mainfrom
JoelSpeed:allow-disable-jira-locally

Conversation

@JoelSpeed

@JoelSpeed JoelSpeed commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The bigquery requirement was added recently and makes local development of the majority of release payload controller difficult (since I'd have to set up a bigquery).

As far as I can tell the bigquery stuff is only used in one of the controllers. This PR makes the bigquery client optional (to match the jira client) for local dev.

Summary by CodeRabbit

  • Bug Fixes
    • The release payload controller now starts and runs when Jira is not configured.
    • BigQuery credentials/settings are enforced only when Jira integration is enabled, preventing unnecessary validation failures.
    • Jira escalation workers are created and started only when both Jira and BigQuery are available, reducing avoidable startup errors.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The release payload controller no longer requires BigQuery credentials during validation and initializes BigQuery only when both credential values are present. A new test verifies Jira escalation controller construction succeeds with a nil BigQuery client.

Changes

Optional BigQuery startup

Layer / File(s) Summary
Optional validation and client initialization
pkg/cmd/release-payload-controller/cmd.go
Jira options remain validated, while BigQuery credentials are optional and client caching is applied only after successful client creation.
Nil BigQuery controller coverage
pkg/cmd/release-payload-controller/jira_escalations_controller_test.go
Adds coverage confirming NewJiraEscalationsController returns a controller without error when its BigQuery client is nil.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: alexnpavel, bradmwilliams

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: BigQuery client configuration is now optional for local development.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JoelSpeed
Once this PR has been reviewed and has the lgtm label, please assign bradmwilliams for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@pkg/cmd/release-payload-controller/cmd.go`:
- Around line 85-98: The Validate method incorrectly accesses the unavailable
flagutil.JiraOptions.Endpoint field. Track whether Jira is configured using a
supported Jira configuration check or stored state, then use that state to gate
the GoogleProjectID and GoogleServiceAccountCredentialFile validations while
preserving the existing Jira validation.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b8bce586-5853-4039-a74c-10028cf52646

📥 Commits

Reviewing files that changed from the base of the PR and between 7587fe0 and f41b142.

📒 Files selected for processing (1)
  • pkg/cmd/release-payload-controller/cmd.go

Comment thread pkg/cmd/release-payload-controller/cmd.go Outdated
@JoelSpeed
JoelSpeed force-pushed the allow-disable-jira-locally branch 2 times, most recently from 0657e65 to fee0591 Compare July 21, 2026 12:50
@JoelSpeed
JoelSpeed force-pushed the allow-disable-jira-locally branch from fee0591 to 7e52046 Compare July 24, 2026 13:03

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/cmd/release-payload-controller/cmd.go (1)

84-89: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require a usable BigQuery client whenever Jira is enabled.

Validate now accepts configured Jira without checking BigQuery, while Run treats missing credentials and NewBigQueryClient failures as non-fatal and passes a nil client to the Jira controller. This violates the stated contract and can silently start a degraded Jira escalation path. Require both credentials and fail startup on BigQuery initialization errors when Jira is configured; retain the optional path only when Jira is disabled.

Also applies to: 147-163

🤖 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 `@pkg/cmd/release-payload-controller/cmd.go` around lines 84 - 89, Update
Options.Validate and the Jira-enabled startup path in Run to require BigQuery
credentials and successfully initialize NewBigQueryClient whenever Jira is
configured; return validation or initialization errors instead of continuing
with a nil client. Preserve the optional BigQuery behavior only when Jira is
disabled.
🤖 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.

Outside diff comments:
In `@pkg/cmd/release-payload-controller/cmd.go`:
- Around line 84-89: Update Options.Validate and the Jira-enabled startup path
in Run to require BigQuery credentials and successfully initialize
NewBigQueryClient whenever Jira is configured; return validation or
initialization errors instead of continuing with a nil client. Preserve the
optional BigQuery behavior only when Jira is disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 78e524fc-999a-4cd9-bb40-d2c168469c29

📥 Commits

Reviewing files that changed from the base of the PR and between fee0591 and 7e52046.

📒 Files selected for processing (2)
  • pkg/cmd/release-payload-controller/cmd.go
  • pkg/cmd/release-payload-controller/jira_escalations_controller_test.go

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@JoelSpeed: 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/govulncheck 7e52046 link false /test govulncheck

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.

@bradmwilliams

Copy link
Copy Markdown
Collaborator

I have the fix for the govulncheck failure in my PR: #803. I'm planning on merging it very soon.

Also, CodeRabbit's latest finding seem legit as well.

@JoelSpeed

Copy link
Copy Markdown
Contributor Author

Also, CodeRabbit's latest finding seem legit as well.

Do you mean #801 (review), this was what I tried to fix in my original patch, but I thought we had concluded that this wasn't possible in a non-hacky way without looking up the flag. Unless I'm missing something, there's no easy way to understand if the jira controller is, or is not enabled

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