Repository navigation
[MrBot] Add pipeline-safe dependency propagation mode - #473
Open
Parth Aggarwal (parth21999) wants to merge 2 commits into
Open
Parth Aggarwal (parth21999) wants to merge 2 commits into
Parth Aggarwal (parth21999) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2cc24a4e-c845-4bfe-99ea-c31ce12fb4bd
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
/AzurePipelines run |
|
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
Member
Author
|
/azp run Azure-C-Build-Tools-Gate |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
The previous commit added -Pipeline by copying the Azure-MessagingStore helpers into update_deps/pipeline_helper_scripts, which left two copies of the propagation code. Merge them into helper_scripts, loaded once by load_helpers.ps1, and branch on the mode only where a workstation and a build agent need different behavior. - propagate_updates.ps1 is the only entry point. -Pipeline selects the noninteractive mode and rejects the interactive-only arguments. - Both modes call Azure DevOps through invoke-ado-rest, using a WAM token from the Azure CLI or a PAT interactively and SYSTEM_ACCESSTOKEN in pipelines. Reads retry transient failures, writes retry only 429/503, and a rejected WAM token is refreshed once. The azure-devops CLI extension is no longer needed. - Both modes use the git mirror cache, bounded and retried network git commands, staging limited to submodules and build/, and the most detailed PR description that fits the service limit. - Interactive mode keeps WAM/PAT sign-in, known_graph.json, -Resume, -AutoFix, existing-PR recovery and the live watchers. Pipeline mode keeps the preflight checks, redaction, greedy scheduling and live graph discovery. - Pipeline git credentials go through GIT_CONFIG_PARAMETERS and replace an Azure DevOps extraheader the caller already configured, so git sends a single Authorization header. - Helpers no longer declare script parameters, which overwrote the entry script's parameters when dot-sourced. - Cancelling an Azure PR watch with Ctrl+C now stops watching, and a failure while closing a failed PR no longer recurses. - Add update_deps/tests/test_propagate_updates.ps1, run by CTest under Windows PowerShell and PowerShell 7 when run_unittests is ON. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2cc24a4e-c845-4bfe-99ea-c31ce12fb4bd
Member
Author
|
/azp run Azure-C-Build-Tools-Gate |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
| if(WIN32 AND ${run_unittests} AND ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")) | ||
| add_subdirectory(update_deps/tests) | ||
| endif() | ||
|
|
Member
Author
There was a problem hiding this comment.
top-level projects never add c-build-tools tests anyway...
| - **Workflow**: `propagate_updates.ps1` builds the dependency graph (`helper_scripts/build_graph.ps1`) and opens PRs bottom-up | ||
| - **Modes**: Interactive by default (WAM or PAT, `gh auth login`, `-Resume`, `-AutoFix`); `-Pipeline` runs unattended on Azure DevOps agents with `SYSTEM_ACCESSTOKEN` and `GH_TOKEN` | ||
| - **Shared helpers**: Both modes load one helper set via `helper_scripts/load_helpers.ps1`; branch on `test-pipeline-mode` only where behavior must differ, and call Azure DevOps through `invoke-ado-rest` | ||
| - **Tests**: `update_deps/tests/test_propagate_updates.ps1` (CTest `update_deps_propagation_test` when `run_unittests=ON`) |
Member
Author
There was a problem hiding this comment.
This is describing the implementation, not how to use it. keep this doc minimal with instructional changes only
| } | ||
| } | ||
|
|
||
| run-test 'command references resolve' { |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update_deps/propagate_updates.ps1gains a-Pipelinemode for unattended Azure DevOps runs, merging the Azure-MessagingStore implementation, while keeping the interactive workflow. Both modes share one helper set.propagate_updates.ps1loadshelper_scripts/throughload_helpers.ps1, and the code branches on the mode only where a workstation and a build agent need different behavior. The earlierpipeline_helper_scripts/copy andpropagate_updates_pipeline.ps1are gone.known_graph.jsonreuse,-Resume,-AutoFix, existing-PR recovery, and the live PR watchers.-Pipelinekeeps the Store behavior. It never prompts, usesSYSTEM_ACCESSTOKENfor Azure DevOps REST and git andGH_TOKENfor GitHub, and runs preflight checks before opening any PR. It also redacts secrets, time-bounds native calls, discovers the graph live, and opens each PR as soon as its dependencies have merged. It supports-azure_work_item,-root_list,-poll_interval, and-NoCloseFailedPr.build/are staged.param()blocks; dot-sourcing them overwrote the entry script's parameters, such as-poll_interval.extraheaderthe caller already set (the EBS YAML sets one), so git sends a singleAuthorizationheader.update_deps/dependency_updates_propagation.mdcovers the modes, the pipeline environment contract, a YAML example, migration, and tests.Pipeline migration
Map
SYSTEM_ACCESSTOKEN: $(System.AccessToken)andGH_TOKENinto the task environment.Validation on
00711e2d4bdd3282, whose parents aremasterand00711e2d.00711e2d, then ran-Pipelineunder Windows PowerShell 5.1 on a real agent:GIT_CONFIG_GLOBAL(bot identity and Azure DevOps extraheader) was kept, andgh auth setup-gitcompleted.SYSTEM_ACCESSTOKENAzure DevOps preflight passed for both roots.permissions.push=falsefor the Azure upstream repositories. No implementation failure was observed. A full write propagation needs an SSO-authorized GitHub token with push access to those repositories.update_deps/tests/test_propagate_updates.ps1passes under Windows PowerShell 5.1 and PowerShell 7.6. Services are mocked, and git runs only against local repositories. The suite covers:update-local-reporun in both modes;Authorizationheader.update_deps_propagation_testandupdate_deps_propagation_pwsh_testwhenrun_unittests=ON. Both pass.git diff --checkis clean. The repository validator reports only its existing findings, none in files touched here.-Resume,-AutoFix, Ctrl+C). The mocked tests cover their logic.Earlier validation
The previous head
07a3146d(before deduplication) passed gate build 186829434 and stopped at the same GitHub write-access preflight in EBS run 186828447.