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

[rush] Azure DevOps pipelines shallow fetch =1 is now default #3663

Closed
kkazala opened this issue Sep 29, 2022 · 1 comment · Fixed by #3668
Closed

[rush] Azure DevOps pipelines shallow fetch =1 is now default #3663

kkazala opened this issue Sep 29, 2022 · 1 comment · Fixed by #3668

Comments

@kkazala
Copy link

kkazala commented Sep 29, 2022

Summary

It's not an issue with rush specifically, but it does have an impact on rush change --verify for example, when invoked in a CI pipeline
Newly created Azure DevOps pipelines have shallow fetch with depth=1 enabled by default, so anything that depends on getMergeBase will fail (in CI, PR works)
Do you think it would make sense to detect it and display a warning?

Repro steps

  1. Clone https:/microsoft/rush-example (or use your existing rush repo)
  2. Create new Azure DevOps pipeline, using ci.yaml
  3. Ensure the shallow fetch is enabled (see Azure DevOps pipelines shallow fetch =1 is now default)
    image
  4. Make a new branch and push few commits
  5. see the results
    image

Details

getMergeBase invokes git --no-optional-locks merge-base HEAD targetBranch

which, if fetchDepth=1 and current commit is NOT the first one after branching, fails with ##[error]PowerShell exited with code '1'.

Standard questions

This is not a rush issue, but does cause rush to fail in Azure DevOps CI pipelines
Would be great if a warning was displayed instead of an error =)

@iclanton
Copy link
Member

iclanton commented Oct 3, 2022

Seems like we should throw an error that specifically says that we can't find a merge base and provide some hints to the user about how to resolve that. Perhaps recommending that they run git fetch --deepen if it's a local clone or increase the fetch depth in the config if it's CI.

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