Fix Go generation deleting non-generated repo tooling (.config, .azure-pipelines)#1446
Open
jingjingjia-ms wants to merge 1 commit into
Open
Fix Go generation deleting non-generated repo tooling (.config, .azure-pipelines)#1446jingjingjia-ms wants to merge 1 commit into
jingjingjia-ms wants to merge 1 commit into
Conversation
…e-pipelines) clean-go-files.ps1 removes every top-level directory in the target repo except a hardcoded allow-list (core, scripts, .github, tests) before regenerating. That allow-list has not changed since 2023-06-12, so directories added since then are deleted wholesale on every generation run. msgraph-sdk-go / msgraph-beta-sdk-go recently gained: - .azure-pipelines/ (added 2026-05-15; daily-ci-build.yml) - .config/ (added 2026-05-27; 1ES autobaselining + Guardian .gdnbaselines) Because these are not in the allow-list and are not regenerated by kiota, every Go generation run deletes them. This surfaced in the first generation PRs created after those files were added (e.g. msgraph-sdk-go #1013/#1014, msgraph-beta-sdk-go #649), each dropping .azure-pipelines/daily-ci-build.yml, .config/1espt/PipelineAutobaseliningConfig.yml and .config/guardian/.gdnbaselines (removing Guardian security-scan baselines). Fix: exclude ALL dot-directories via the ".*" wildcard (matches .github, .config, .azure-pipelines, .vscode, .devcontainer, ...) in addition to core/scripts/tests. Generated model/request-builder directories never start with a dot, so they are still cleaned. Both v1.0 and beta Go stages share this script (go.yml@self), so this single change fixes both repos. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
scripts/clean-go-files.ps1deletes every top-level directory in the target repo except a hardcoded allow-list —core,scripts,.github,tests— before regenerating:That allow-list hasn't changed since 2023-06-12, so any directory added since then is deleted wholesale on every Go generation run (kiota only regenerates the model/request-builder dirs, so anything else just vanishes from the branch).
msgraph-sdk-go/msgraph-beta-sdk-gorecently gained repo tooling that isn't in the list:.azure-pipelines/— added 2026-05-15 (daily-ci-build.yml).config/— added 2026-05-27 (1ES autobaselining + Guardian.gdnbaselines)So the first generation PRs created after those files were added delete them:
microsoftgraph/msgraph-sdk-go#1013,#1014microsoftgraph/msgraph-beta-sdk-go#649Each drops
.azure-pipelines/daily-ci-build.yml,.config/1espt/PipelineAutobaseliningConfig.yml, and.config/guardian/.gdnbaselines— removing CI config and security-scan baselines.Fix
Exclude all dot-directories via the
.*wildcard (matches.github,.config,.azure-pipelines,.vscode,.devcontainer, …) in addition tocore/scripts/tests. Generated model/request-builder directories never start with a dot, so they are still cleaned.Verified in isolation: with
-Exclude @("core","scripts","tests",".*"),models/applicationsare still returned for deletion while.github/.config/.azure-pipelines/.vscodeare protected.Both the v1.0 and beta Go stages share this script (
go.yml@self), so this single change fixes both repos.Microsoft Reviewers: Open in CodeFlow