Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ jobs:

- job: CheckHeaders
displayName: "Check License, History, and DocMap"

condition: and(not(contains(variables['Build.SourceBranch'], 'lts')), not(contains(variables['System.PullRequest.TargetBranch'], 'lts')))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In LTS PR:
Expanded: and(not(contains('refs/pull/30848/merge', 'lts')), not(contains('dev-lts-2.66', 'lts')))

In batched CI, System.PullRequest.TargetBranch is an empty string, and the condition is still correct.

Evaluating: and(not(contains(variables['Build.SourceBranch'], 'lts')), not(contains(variables['System.PullRequest.TargetBranch'], 'lts')))
Expanded: and(not(contains('refs/heads/lts-skip-version-check', 'lts')), not(contains(variables['System.PullRequest.TargetBranch'], 'lts')))

Copy link
Member

Choose a reason for hiding this comment

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

We don't need to consider Build.SourceBranch being refs/pull/30848/merge (PR) and System.PullRequest.TargetBranch being '' (batched CI) at all.

For PR, as contains('dev-lts-2.66', 'lts') is true, the and() fails. For batched CI, as contains('refs/heads/lts-skip-version-check', 'lts') is true, and() fails.

Maybe using or() makes the logic easier to understand:

not(or(contains(variables['Build.SourceBranch'], 'lts'), contains(variables['System.PullRequest.TargetBranch'], 'lts')))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

System.PullRequest.TargetBranch being '' is evaluated in dev branch batched CI.
not(contains('refs/heads/dev', 'lts') is true, and it will check not(contains('', 'lts').

pool:
name: ${{ variables.ubuntu_pool }}
steps:
Expand Down