Skip to content

Conversation

@Aaronontheweb
Copy link
Member

Summary

  • Adds dynamic base branch detection for Incrementalist in Azure DevOps pipelines
  • Prevents unnecessary full builds when PRs target version branches (e.g., v1.5) instead of dev

Changes

  • Added incrementalist.baseBranch variable to pipeline templates that:
    • Uses System.PullRequest.TargetBranch for PR builds
    • Defaults to 'dev' for non-PR builds
  • Updated all Incrementalist commands to use --branch $(incrementalist.baseBranch) parameter

Impact

When a PR targets v1.5, Incrementalist will now correctly compare against v1.5 instead of dev, avoiding full builds when only specific projects have changed between v1.5 and the PR branch.

This solves the issue where PRs to version branches would always trigger full builds because Incrementalist was comparing against dev (which contains v1.6 code) instead of the actual target branch.

Test Plan

The pipeline changes will be validated when this PR runs through Azure DevOps.

- Add dynamic incrementalist.baseBranch variable to pipeline templates
- Use System.PullRequest.TargetBranch for PR builds
- Default to 'dev' for non-PR builds
- Update all Incrementalist commands to use --branch parameter

This allows PRs targeting version branches (e.g., v1.5) to correctly
compare against their target branch instead of always using dev,
avoiding unnecessary full builds.
@Aaronontheweb
Copy link
Member Author

This should, ideally, prevent any future PRs being sent to the v1.5 branch from getting compared to dev, which will trigger a full rebuild each time

- Use PowerShell script to extract branch name from System.PullRequest.TargetBranch
- Strip 'refs/heads/' prefix from target branch reference
- Set IncrementalistBaseBranch variable dynamically at runtime
- Update all Incrementalist commands to use the new variable

This fixes the issue where PR builds always used 'dev' as the base branch
even when targeting version branches like v1.5.
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) August 26, 2025 14:02
@Aaronontheweb Aaronontheweb merged commit f2c311f into akkadotnet:v1.5 Aug 26, 2025
11 checks passed
Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this pull request Aug 26, 2025
…kkadotnet#7791)

* Parameterize Incrementalist base branch for Azure DevOps pipelines

- Add dynamic incrementalist.baseBranch variable to pipeline templates
- Use System.PullRequest.TargetBranch for PR builds
- Default to 'dev' for non-PR builds
- Update all Incrementalist commands to use --branch parameter

This allows PRs targeting version branches (e.g., v1.5) to correctly
compare against their target branch instead of always using dev,
avoiding unnecessary full builds.

* Fix Incrementalist base branch detection for Azure DevOps PRs

- Use PowerShell script to extract branch name from System.PullRequest.TargetBranch
- Strip 'refs/heads/' prefix from target branch reference
- Set IncrementalistBaseBranch variable dynamically at runtime
- Update all Incrementalist commands to use the new variable

This fixes the issue where PR builds always used 'dev' as the base branch
even when targeting version branches like v1.5.
@Aaronontheweb Aaronontheweb deleted the parameterize-base-branch-incrementalist branch August 26, 2025 14:18
Aaronontheweb added a commit that referenced this pull request Aug 26, 2025
…7791) (#7792)

* Parameterize Incrementalist base branch for Azure DevOps pipelines

- Add dynamic incrementalist.baseBranch variable to pipeline templates
- Use System.PullRequest.TargetBranch for PR builds
- Default to 'dev' for non-PR builds
- Update all Incrementalist commands to use --branch parameter

This allows PRs targeting version branches (e.g., v1.5) to correctly
compare against their target branch instead of always using dev,
avoiding unnecessary full builds.

* Fix Incrementalist base branch detection for Azure DevOps PRs

- Use PowerShell script to extract branch name from System.PullRequest.TargetBranch
- Strip 'refs/heads/' prefix from target branch reference
- Set IncrementalistBaseBranch variable dynamically at runtime
- Update all Incrementalist commands to use the new variable

This fixes the issue where PR builds always used 'dev' as the base branch
even when targeting version branches like v1.5.
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.

1 participant