Skip to content

hcpctl: prefer provision-environment config over write-config#5387

Open
mmazur wants to merge 1 commit into
Azure:mainfrom
mmazur:vault/use-all-configs
Open

hcpctl: prefer provision-environment config over write-config#5387
mmazur wants to merge 1 commit into
Azure:mainfrom
mmazur:vault/use-all-configs

Conversation

@mmazur
Copy link
Copy Markdown
Collaborator

@mmazur mmazur commented May 26, 2026

Summary

  • Prefer aro-hcp-provision-environment/artifacts/config.yaml as the primary config source when fetching Prow job data, cause the provisioning job makes modifications on top of the base config/config.yaml when running (like generating custom resource group names), which makes the config it generates more accurate
  • Fall back to aro-hcp-write-config/artifacts/config.yaml path when the prov job config isn't there – it doesn't have all the data (it's just a rendered config/config.yaml), but it is always available no matter the environment

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 26, 2026 10:28
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mmazur

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates hcpctl’s Prow artifact parsing to prefer the newer aro-hcp-provision-environment job artifact config as the primary source of truth, while retaining compatibility with older jobs by falling back to the previous aro-hcp-write-config artifact path.

Changes:

  • Switch config download to try aro-hcp-provision-environment/artifacts/config.yaml first.
  • Add fallback to aro-hcp-write-config/artifacts/config.yaml when the primary config is unavailable.

Comment on lines 172 to +176
configData, err := downloadObject(ctx, gcsClient, configGCSPath)
if err != nil {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
logger.V(1).Info("Primary config path not found, trying fallback", "primary", configGCSPath, "err", err)
configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback)
configData, err = downloadObject(ctx, gcsClient, configGCSPath)
@mmazur mmazur force-pushed the vault/use-all-configs branch from ec7c41d to 66635a6 Compare May 26, 2026 11:00
The aro-hcp-provision-environment/artifacts/config.yaml is more
accurate than aro-hcp-write-config/artifacts/config.yaml. Try the
provision-environment path first and fall back to write-config when
it is not present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 11:20
@mmazur mmazur force-pushed the vault/use-all-configs branch from 66635a6 to 94cb303 Compare May 26, 2026 11:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +176 to +182
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
}
logger.V(1).Info("Primary config not present, trying fallback", "primary", configGCSPath)
configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback)
configData, err = downloadObject(ctx, gcsClient, configGCSPath)
if err != nil {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
Comment on lines 173 to 184
configData, err := downloadObject(ctx, gcsClient, configGCSPath)
if err != nil {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
if !errors.Is(err, storage.ErrObjectNotExist) {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
}
logger.V(1).Info("Primary config not present, trying fallback", "primary", configGCSPath)
configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback)
configData, err = downloadObject(ctx, gcsClient, configGCSPath)
if err != nil {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants