Skip to content
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

[ARM Incremental TypeSpec] Fails if file is deleted #32731

Open
mikeharder opened this issue Feb 20, 2025 · 1 comment
Open

[ARM Incremental TypeSpec] Fails if file is deleted #32731

mikeharder opened this issue Feb 20, 2025 · 1 comment
Assignees

Comments

@mikeharder
Copy link
Member

mikeharder commented Feb 20, 2025

If a swagger file is deleted, check "ARM Incremental TypeSpec" will fail, because it calls "git show HEAD", which fails because the file doesn't exist in "HEAD".

Options:

  1. If a swagger file has been deleted (or cannot be read from "HEAD" for any reason), set "incremental-typespec=false". These cases should be rare, and it's always safe to "fail false". This is simpler than other options and should be good enough.

  2. If a swagger file has been deleted, read the file from "HEAD^" instead. This seems reasonable, because it uses the state of the file before it was delete to determine if the file was tsp-generated. However, the next part of the check for "did spec folder contain TSP before the PR" now gets complicated, because what if the deleted swagger was the only tsp-generated swagger in the spec? This might be more trouble than it's worth.

  3. Some other logic we think maps "deleted typespec-generated swagger" to "is incremental change to typespec RP".

Examples

PR: #32148
Workflow: https://github.com/Azure/azure-rest-api-specs/actions/runs/13410138078/job/37458240060#step:3:94

PR: #32727
Workflow: https://github.com/Azure/azure-rest-api-specs/actions/runs/13428893874/job/37516774509#step:3:123

@mikeharder mikeharder self-assigned this Feb 20, 2025
@mikeharder mikeharder moved this from 🤔 Triage to 🐝 Dev in Azure SDK EngSys 🤖🧠 Feb 20, 2025
@mikeharder
Copy link
Member Author

@rkmanda: What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant