Skip to content

Update Velero hook scripts to rewrite go.mod require with branch-aligned upstream tags and replace with downstream branches#39

Draft
Copilot wants to merge 8 commits into
oadp-devfrom
copilot/update-velero-requires
Draft

Update Velero hook scripts to rewrite go.mod require with branch-aligned upstream tags and replace with downstream branches#39
Copilot wants to merge 8 commits into
oadp-devfrom
copilot/update-velero-requires

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

Current Velero hooks only rewrote replace, leaving require potentially inconsistent with intended Velero version metadata.

  • Scope

    • Updated:
      • rebasebot-hook-scripts/go-replace_velero_oadp-dev.sh
      • rebasebot-hook-scripts/go-replace_velero_oadp-1.6.sh
      • rebasebot-hook-scripts/go-replace_velero_oadp-1.5.sh
  • Behavior change

    • Hooks continue to update Velero replace entries to the target downstream branch (oadp-dev / oadp-1.6 / oadp-1.5).
    • Hooks now rewrite Velero require entries using an upstream Velero tag (for example v1.18.1 or v1.18.1-rc.2), not downstream branch names.
    • require version source is now derived from existing branch-specific context in the scripts (no new input variable):
      • oadp-1.6: fixed aligned upstream tag v1.18.1
      • oadp-1.5: latest aligned v1.16.x upstream release tag from Velero tags
      • oadp-dev: latest upstream Velero tag (including RC tags)
    • Supports both valid go.mod forms:
      • single-line require: require github.com/.../... vX.Y.Z
      • require-block entries: github.com/.../... vX.Y.Z
    • Existing stale opposite-module replace cleanup remains unchanged.
    • For API-based tag resolution (oadp-dev and oadp-1.5), scripts now:
      • fetch tags with pagination (not only first page),
      • use Authorization: Bearer when GITHUB_TOKEN is present,
      • fail with explicit errors when tag fetch fails.
  • Result

    • require now reflects branch-aligned upstream Velero version intent, while replace continues to pin to downstream forks/branches, preventing mixed or misleading dependency metadata during rebase automation.
# before (example)
require github.com/velero-io/velero v1.16.2
replace github.com/velero-io/velero => github.com/openshift/velero oadp-dev

# after running hook
require github.com/velero-io/velero v1.18.1
replace github.com/velero-io/velero => github.com/openshift/velero oadp-dev

Copilot AI linked an issue May 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update velero requires to reflect intended version Update Velero hook scripts to rewrite both go.mod require and replace entries May 27, 2026
Copilot AI requested a review from kaovilai May 27, 2026 21:26
@kaovilai
Copy link
Copy Markdown
Contributor

@copilot not downstream tag, but closest aligned upstream velero version such as v1.18.1, v1.18.1-rc.2, etc.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot not downstream tag, but closest aligned upstream velero version such as v1.18.1, v1.18.1-rc.2, etc.

Updated in commit 2d9eddf. The Velero hooks no longer write downstream branch values into require; they now use an upstream Velero tag (existing upstream-style tag from go.mod, or explicit VELERO_REQUIRE_VERSION, including rc tags like v1.18.1-rc.2).

Copilot AI changed the title Update Velero hook scripts to rewrite both go.mod require and replace entries Update Velero hook scripts to rewrite go.mod require with upstream tags and replace with downstream branches May 27, 2026
@kaovilai
Copy link
Copy Markdown
Contributor

@copilot This change introduces a new env var, VELERO_REQUIRE_VERSION, but I don’t see that variable defined or passed anywhere else in this repo. Can we avoid adding a new input and instead make the hook determine the target Velero upstream tag from existing branch-specific context already used by these scripts?

Right now the fallback just preserves whatever upstream-looking version is already in go.mod, which doesn’t actually guarantee we rewrite to the correct version. Please revise this so the hook works without introducing a new variable.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@copilot This change introduces a new env var, VELERO_REQUIRE_VERSION, but I don’t see that variable defined or passed anywhere else in this repo. Can we avoid adding a new input and instead make th...

Updated in commit 843937e. Removed VELERO_REQUIRE_VERSION and switched to branch-context-driven require tag selection in the hooks: oadp-1.6 uses v1.18.1, oadp-1.5 resolves latest v1.16.x, and oadp-dev resolves latest upstream tag; all without introducing a new input variable.

Copilot AI changed the title Update Velero hook scripts to rewrite go.mod require with upstream tags and replace with downstream branches Update Velero hook scripts to rewrite go.mod require with branch-aligned upstream tags and replace with downstream branches May 28, 2026
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.

Update velero requires, not just replace.

2 participants