Skip to content

Pass the --ci argument to darc in SDK's CI #45248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
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 .devcontainer/vmr/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ vmr_branch=$(git -C "$sdk_dir" log --pretty=format:'%D' HEAD^ \
| sed 's@origin/@@' \
| sed 's@,.*@@')

"$workspace_dir/synchronize-vmr.sh" --branch "$vmr_branch" --debug
"$workspace_dir/synchronize-vmr.sh" --branch "$vmr_branch" --ci --debug

cd "$vmr_dir"
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/vmr-pull-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ steps:
--remote "sdk:$(Agent.BuildDirectory)/sdk"
--component-template $(Agent.BuildDirectory)/sdk/src/VirtualMonoRepo/Component.template.md
--tpn-template $(Agent.BuildDirectory)/sdk/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt
--ci
--debug
||
(echo "##vso[task.logissue type=error]Failed to synchronize the VMR" && exit 1)
Expand All @@ -76,6 +77,7 @@ steps:
# -remote "sdk:$(Agent.BuildDirectory)/sdk"
-componentTemplate $(Agent.BuildDirectory)/sdk/src/VirtualMonoRepo/Component.template.md `
-tpnTemplate $(Agent.BuildDirectory)/sdk/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt `
-ci
-debugOutput

if ($LASTEXITCODE -ne 0) {
Expand Down
10 changes: 9 additions & 1 deletion eng/vmr-sync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Optional. Path to the dotnet/dotnet repository. When null, gets cloned to the te

.PARAMETER debugOutput
Optional. Enables debug logging in the darc vmr command.

.PARAMETER ci
Optional. Denotes that the script is running in a CI environment.
#>
param (
[Parameter(Mandatory=$true, HelpMessage="Path to the temporary folder where repositories will be cloned")]
Expand All @@ -77,6 +80,7 @@ param (
[string]$tpnTemplate = "src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt",
[string]$azdevPat,
[string][Alias('v', 'vmr')]$vmrDir,
[switch]$ci,
[switch]$debugOutput
)

Expand Down Expand Up @@ -189,12 +193,16 @@ $darcArgs = (
"--discard-patches",
"--generate-credscansuppressions",
$repository
)
)

if ($recursive) {
$darcArgs += ("--recursive")
}

if ($ci) {
$darcArgs += ("--ci")
}

if ($additionalRemotes) {
$darcArgs += ("--additional-remotes", $additionalRemotes)
}
Expand Down
10 changes: 10 additions & 0 deletions eng/vmr-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ verbosity=verbose
component_template="$sdk_dir/src/VirtualMonoRepo/Component.template.md"
tpn_template="$sdk_dir/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt"
azdev_pat=''
ci=false

# If sdk is a repo, we're in an sdk and not in the dotnet/dotnet repo
if [[ -d "$sdk_dir/.git" ]]; then
Expand Down Expand Up @@ -151,6 +152,9 @@ while [[ $# -gt 0 ]]; do
azdev_pat=$2
shift
;;
--ci)
ci=true
;;
-d|--debug)
verbosity=debug
;;
Expand Down Expand Up @@ -259,6 +263,11 @@ if [[ -n "$azdev_pat" ]]; then
azdev_pat="--azdev-pat $azdev_pat"
fi

ci_arg=''
if [[ "$ci" == "true" ]]; then
ci_arg="--ci"
fi

# Synchronize the VMR

"$dotnet" darc vmr update \
Expand All @@ -267,6 +276,7 @@ fi
$azdev_pat \
--$verbosity \
$recursive_arg \
$ci_arg \
$additional_remotes \
--component-template "$component_template" \
--tpn-template "$tpn_template" \
Expand Down