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

CI builds fail with "does master exist?" #517

Open
nategreen opened this issue Jan 20, 2021 · 41 comments
Open

CI builds fail with "does master exist?" #517

nategreen opened this issue Jan 20, 2021 · 41 comments

Comments

@nategreen
Copy link

Affected Packages

@changesets/cli
@changesets/git

Problem

It seems that 2.13.0 of @changesets/cli broke our CI builds. (I'm assuming that's because of the update to @changesets/git.) We now get this when running changeset status on PRs:

🦋  error Error: Failed to find where HEAD diverged from master. Does master exist?
🦋  error     at getDivergedCommit (/opt/hostedtoolcache/node/12.20.1/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:58:11)
🦋  error     at async getChangedFilesSince (/opt/hostedtoolcache/node/12.20.1/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:169:22)
🦋  error     at async Object.getChangedPackagesSinceRef (/opt/hostedtoolcache/node/12.20.1/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:208:24)
🦋  error     at async getStatus (/opt/hostedtoolcache/node/12.20.1/x64/lib/node_modules/@changesets/cli/dist/cli.cjs.dev.js:953:27)
🦋  error     at async run$1 (/opt/hostedtoolcache/node/12.20.1/x64/lib/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1197:11)

We're running this on Ubuntu machines ("latest" version) in Azure Pipelines. Couldn't reproduce the problem locally.

Confirmed that installing @changesets/cli version 2.12.0 fixed the problem.

Proposed solution

🤷‍♂️ No clue. Let me know if there is other info I can provide to help debug. Thanks!

@Andarist
Copy link
Member

Just to confirm - your git repo does have a master branch? Or is the base branch named differently?

@nategreen
Copy link
Author

Yeah, there is still a master branch and nothing has changed.

Initially when we started seeing this, it happened to be on a branch created from another branch. We tried rebasing onto master, and also creating a fresh branch from master, each of which had the same results.

@Andarist
Copy link
Member

Could you check if this is also failing for you locally? What's your git version on a failing machine? Could you try to run there git merge-base master HEAD and paste in the result?

@nategreen
Copy link
Author

nategreen commented Jan 21, 2021

I did try running it locally in my initial efforts to debug/fix it. It worked fine locally, which was puzzling.

On the machine: git version 2.29.2.

The pipeline definition uses checkout: self to do the initial checkout of the repo. Here's an excerpt of the output from that checkout:

Syncing repository: <repo-name> (Git)
git version
git version 2.29.2
git lfs version
git-lfs/2.12.1 (GitHub; linux amd64; go 1.13.4)
git init "/home/vsts/work/1/s"
Initialized empty Git repository in /home/vsts/work/1/s/.git/
git remote add origin <repo-url>
git config gc.auto 0
git config --get-all http.<repo-url>.extraheader
git config --get-all http.proxy
git config http.version HTTP/1.1
git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin

When I ran the command you said, it output:

Generating script.
Script contents:
git merge-base master HEAD
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/4794dd39-a5bf-434a-824b-36f2d97d708c.sh
fatal: Not a valid object name master
##[error]Bash exited with code '128'.

@nategreen
Copy link
Author

Just out of curiosity, I tried git merge-base main HEAD (since main is now the default branch name in new repos)…that didn't work either. Same result: fatal: Not a valid object name main

@Andarist
Copy link
Member

Are you sure that your setup was/is working correctly with the @changesets/[email protected]? I would suspect that it just always return success from the status command (if it's not erroring).

I was able to reproduce your issue using the given git commands and they just don't lead to a proper checkout - is it, maybe, done afterward in your pipeline? Your cwd is pretty much empty, without any files in it (well, not counting .git directory). You are on a local master branch that has no commits on it. I would expect you to sync your empty master branch with the correct remote by doing smth like:

git pull -f origin master:master

This won't completely solve the issue yet - because the status compares the current HEAD to your base branch and you are not checked out on the correct commit yet! at this point. So I would expect that you'd run changeset status after doing a proper checkout.

@nategreen
Copy link
Author

Maybe I missed some git activity between the steps I sent.

I do know that it was working before; it fails when there are no changesets in the PR branch and succeeds when they're added.

@Andarist
Copy link
Member

Could u take a look and lost all git activities then? And also mention at what exact step changeset gets executed? It would help understanding the issue better.

@nategreen
Copy link
Author

Here's the full log (with some details removed for brevity or security).

2021-01-21T14:31:01.8215392Z ##[section]Starting: Job
2021-01-21T14:31:02.0367887Z ##[section]Starting: Initialize job
2021-01-21T14:31:02.0369182Z Agent name: 'Hosted Agent'
2021-01-21T14:31:02.0369521Z Agent machine name: '<machine-name>'
2021-01-21T14:31:02.0369753Z Current agent version: '2.181.0'
2021-01-21T14:31:02.0412957Z ##[group]Operating System
2021-01-21T14:31:02.0413193Z Ubuntu
2021-01-21T14:31:02.0413351Z 18.04.5
2021-01-21T14:31:02.0413479Z LTS
2021-01-21T14:31:02.0413616Z ##[endgroup]
2021-01-21T14:31:02.0413784Z ##[group]Virtual Environment
2021-01-21T14:31:02.0413999Z Environment: ubuntu-18.04
2021-01-21T14:31:02.0414182Z Version: 20201210.0
2021-01-21T14:31:02.0414505Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201210.0/images/linux/Ubuntu1804-README.md
2021-01-21T14:31:02.0414814Z ##[endgroup]
2021-01-21T14:31:02.0415783Z Current image version: '20201210.0'
2021-01-21T14:31:02.0420601Z Agent running as: 'vsts'
2021-01-21T14:31:02.0467556Z Prepare build directory.
2021-01-21T14:31:02.0739327Z Set build variables.
2021-01-21T14:31:02.0773229Z Download all required tasks.
2021-01-21T14:31:02.0911622Z Downloading task: Bash (3.179.0)
2021-01-21T14:31:03.8212339Z Checking job knob settings.
2021-01-21T14:31:03.8220886Z    Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
2021-01-21T14:31:03.8221949Z    Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
2021-01-21T14:31:03.8222608Z Finished checking job knob settings.
2021-01-21T14:31:03.8486732Z Start tracking orphan processes.
2021-01-21T14:31:03.8676250Z ##[section]Finishing: Initialize job
2021-01-21T14:31:03.9041475Z ##[section]Starting: Checkout mri-design-system@debug-changesets-git to s
2021-01-21T14:31:03.9285217Z ==============================================================================
2021-01-21T14:31:03.9286098Z Task         : Get sources
2021-01-21T14:31:03.9286596Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-01-21T14:31:03.9286918Z Version      : 1.0.0
2021-01-21T14:31:03.9287307Z Author       : Microsoft
2021-01-21T14:31:03.9287905Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2021-01-21T14:31:03.9288271Z ==============================================================================
2021-01-21T14:31:04.8233671Z Syncing repository: <> (Git)
2021-01-21T14:31:04.8236629Z ##[command]git version
2021-01-21T14:31:04.8240553Z git version 2.29.2
2021-01-21T14:31:04.8241661Z ##[command]git lfs version
2021-01-21T14:31:04.8245550Z git-lfs/2.12.1 (GitHub; linux amd64; go 1.13.4)
2021-01-21T14:31:04.8247226Z ##[command]git init "/home/vsts/work/1/s"
2021-01-21T14:31:04.8250582Z Initialized empty Git repository in /home/vsts/work/1/s/.git/
2021-01-21T14:31:04.8252001Z ##[command]git remote add origin <repo-url>
2021-01-21T14:31:04.8259635Z ##[command]git config gc.auto 0
2021-01-21T14:31:04.8263802Z ##[command]git config --get-all http.<repo-url>.extraheader
2021-01-21T14:31:04.8267430Z ##[command]git config --get-all http.proxy
2021-01-21T14:31:04.8270796Z ##[command]git config http.version HTTP/1.1
2021-01-21T14:31:04.8277660Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin
2021-01-21T14:31:04.9133333Z remote: Azure Repos        
2021-01-21T14:31:05.6152460Z remote: 
2021-01-21T14:31:05.6158966Z remote: Found 17199 objects to send. (168 ms)        
2021-01-21T14:31:05.6166070Z Receiving objects:   0% (1/17199)
2021-01-21T14:31:05.6167140Z Receiving objects:   1% (172/17199)
...
2021-01-21T14:31:06.0758096Z Receiving objects: 100% (17199/17199), 15.08 MiB | 17.67 MiB/s, done.
2021-01-21T14:31:06.0787515Z Resolving deltas:   0% (0/9495)
2021-01-21T14:31:06.0887593Z Resolving deltas:   1% (95/9495)
2021-01-21T14:31:06.0899897Z Resolving deltas:   2% (190/9495)
...
2021-01-21T14:31:06.4974043Z Resolving deltas: 100% (9495/9495)
2021-01-21T14:31:06.4975032Z Resolving deltas: 100% (9495/9495), done.
2021-01-21T14:31:06.7738784Z From <repo-url>
2021-01-21T14:31:06.7831062Z  * [new branch]      Adding-kendo-grid-styles    -> origin/Adding-kendo-grid-styles
... (all branches)
2021-01-21T14:31:06.7937462Z  * [new branch]      validation-states           -> origin/validation-states
2021-01-21T14:31:06.7938996Z  * [new tag]         @mri/[email protected]  -> @mri/[email protected]

... (all tags)
2021-01-21T14:31:06.8210649Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
2021-01-21T14:31:06.8211680Z  * [new tag]         v0.3.0-pre.0                -> v0.3.0-pre.0
2021-01-21T14:31:06.9030276Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin +f3ce...f72d:refs/remotes/origin/f3ce...f72d
2021-01-21T14:31:07.2093840Z From <repo-url>
2021-01-21T14:31:07.2095108Z  * [new ref]           f3ce...f72d -> origin/f3ce...f72d
2021-01-21T14:31:07.2541266Z ##[command]git checkout --progress --force f3ce...f72d
2021-01-21T14:31:07.2544990Z Note: switching to 'f3ce...f72d'.
2021-01-21T14:31:07.2545196Z 
2021-01-21T14:31:07.2545621Z You are in 'detached HEAD' state. You can look around, make experimental
2021-01-21T14:31:07.2546089Z changes and commit them, and you can discard any commits you make in this
2021-01-21T14:31:07.2546457Z state without impacting any branches by switching back to a branch.
2021-01-21T14:31:07.2546730Z 
2021-01-21T14:31:07.2546993Z If you want to create a new branch to retain commits you create, you may
2021-01-21T14:31:07.2547640Z do so (now or later) by using -c with the switch command. Example:
2021-01-21T14:31:07.2547977Z 
2021-01-21T14:31:07.2548852Z   git switch -c <new-branch-name>
2021-01-21T14:31:07.2549146Z 
2021-01-21T14:31:07.2553650Z Or undo this operation with:
2021-01-21T14:31:07.2553928Z 
2021-01-21T14:31:07.2554464Z   git switch -
2021-01-21T14:31:07.2554586Z 
2021-01-21T14:31:07.2554929Z Turn off this advice by setting config variable advice.detachedHead to false
2021-01-21T14:31:07.2555229Z 
2021-01-21T14:31:07.2555457Z HEAD is now at f3ce... Use latest @changesets/cli
2021-01-21T14:31:07.2561128Z ##[command]git config http.<repo-url>.extraheader "AUTHORIZATION: bearer ***"
2021-01-21T14:31:07.2651091Z ##[section]Finishing: Checkout mri-design-system@debug-changesets-git to s
2021-01-21T14:31:07.2676233Z ##[section]Starting: Bash
2021-01-21T14:31:07.2683847Z ==============================================================================
2021-01-21T14:31:07.2684164Z Task         : Bash
2021-01-21T14:31:07.2684430Z Description  : Run a Bash script on macOS, Linux, or Windows
2021-01-21T14:31:07.2684686Z Version      : 3.179.0
2021-01-21T14:31:07.2684936Z Author       : Microsoft Corporation
2021-01-21T14:31:07.2685272Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2021-01-21T14:31:07.2685643Z ==============================================================================
2021-01-21T14:31:07.7705754Z Generating script.
2021-01-21T14:31:07.7706685Z Script contents:
2021-01-21T14:31:07.7707082Z git merge-base master HEAD
2021-01-21T14:31:07.7707880Z ========================== Starting Command Output ===========================
2021-01-21T14:31:07.7711337Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/4794...d708c.sh
2021-01-21T14:31:07.7711676Z fatal: Not a valid object name master
2021-01-21T14:31:07.7740150Z ##[error]Bash exited with code '128'.
2021-01-21T14:31:07.7764989Z ##[section]Finishing: Bash
2021-01-21T14:31:07.7786481Z ##[section]Starting: Checkout mri-design-system@debug-changesets-git to s
2021-01-21T14:31:07.7789906Z ==============================================================================
2021-01-21T14:31:07.7790186Z Task         : Get sources
2021-01-21T14:31:07.7790532Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-01-21T14:31:07.7790814Z Version      : 1.0.0
2021-01-21T14:31:07.7791000Z Author       : Microsoft
2021-01-21T14:31:07.7791405Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2021-01-21T14:31:07.7791770Z ==============================================================================
2021-01-21T14:31:08.0874175Z Cleaning any cached credential from repository: mri-design-system (Git)
2021-01-21T14:31:08.1078780Z ##[command]git version
2021-01-21T14:31:08.1414046Z git version 2.29.2
2021-01-21T14:31:08.1472981Z ##[command]git lfs version
2021-01-21T14:31:08.1585587Z git-lfs/2.12.1 (GitHub; linux amd64; go 1.13.4)
2021-01-21T14:31:08.1628292Z ##[command]git config --unset-all http.<repo-url>.extraheader
2021-01-21T14:31:08.1738150Z ##[section]Finishing: Checkout mri-design-system@debug-changesets-git to s
2021-01-21T14:31:08.1797942Z ##[section]Starting: Finalize Job
2021-01-21T14:31:08.1829274Z Cleaning up task key
2021-01-21T14:31:08.1830596Z Start cleaning up orphan processes.
2021-01-21T14:31:08.2159494Z ##[section]Finishing: Finalize Job
2021-01-21T14:31:08.2199125Z ##[section]Finishing: Job

@akphi
Copy link
Contributor

akphi commented Mar 9, 2021

Are you sure that your setup was/is working correctly with the @changesets/[email protected]? I would suspect that it just always return success from the status command (if it's not erroring).

I was able to reproduce your issue using the given git commands and they just don't lead to a proper checkout - is it, maybe, done afterward in your pipeline? Your cwd is pretty much empty, without any files in it (well, not counting .git directory). You are on a local master branch that has no commits on it. I would expect you to sync your empty master branch with the correct remote by doing smth like:

git pull -f origin master:master

This won't completely solve the issue yet - because the status compares the current HEAD to your base branch and you are not checked out on the correct commit yet! at this point. So I would expect that you'd run changeset status after doing a proper checkout.

@Andarist I have a github action that has a step calling changeset status --since=master. This works locally and fails in the pipeline. Your workaround really works. But I don't quite get your explanation. Apparently, when I log out git status, the output is HEAD detached at pull/82/merge.

We just adopted changesets and we are looking for a way to fail the gate on each PR build if changeset is not present for all changed package. I wonder if this is something changesets can support or is it something you would prefer the bot to do.

@emmatown
Copy link
Member

emmatown commented Mar 9, 2021

I have a github action that has a step calling changeset status --since=master. This works locally and fails in the pipeline. Your workaround really works. But I don't quite get your explanation. Apparently, when I log out git status, the output is HEAD detached at pull/82/merge.

You most likely need to set fetch-depth: 0 in actions/checkout so that it will include all the Git history

- name: Checkout Repo
  uses: actions/checkout@main
  with:
    fetch-depth: 0

@akphi
Copy link
Contributor

akphi commented Mar 9, 2021

@mitchellhamilton yes, I did that and the error is still there. I wonder if you can see my pipeline. You can see the error there.
https://github.com/akphi/config-tester/pull/76/checks?check_run_id=2062957909

@Andarist
Copy link
Member

Andarist commented Mar 9, 2021

@nategreen I don't quite see in this log the moment in which changesets are invoked 🤔

@akphi it's quite hard to tell what has gone wrong - all refs should be downloaded in your case as per the action's source code:
https://github.com/actions/checkout/blob/25a956c84d5dd820d28caab9f86b8d183aeeff3d/src/git-source-provider.ts#L128-L134

Could you try running those on your action before you invoke changeset?

git merge-base master HEAD
git merge-base origin/master HEAD
git branch -r

@rohit-gohri
Copy link
Contributor

I also have a similar problem with the following setup:

  • Default branch: develop
  • Production branch: main
  • In config.json I have set "baseBranch": "main"
  • Added fetch-depth: 0 to workflow

But I still get this error:
error Error: Failed to find where HEAD diverged from main. Does main exist?

I tried adding git fetch origin main:main before the changeset cmd but it still gives the same error:

Run git fetch origin main:main
  git fetch origin main:main
  npx changeset status
  shell: /usr/bin/bash -e {0}
From owner/repo
 * [new branch]      main       -> main
 * [new branch]      main       -> origin/main
🦋  error Error: Failed to find where HEAD diverged from main. Does main exist?

Could this be due to the way checkout is done for PRs? Checkout step logs:

 /usr/bin/git checkout --progress --force refs/remotes/pull/117/merge
  Note: switching to 'refs/remotes/pull/117/merge'.
  
  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.
  

@Andarist
Copy link
Member

Andarist commented Mar 9, 2021

Could this be due to the way checkout is done for PRs? Checkout step logs:

Definitely. I'm not a git expert though so usually I have to experiment quite a bit when it comes to such less known command/flags.

As mentioned in the previous post - I'm still surprised that you both don't get your base branches fetched with fetch-depth: 0 though as the source code of the checkout action explicitly mentions that it should be fetched. That being said - I think we can do better and fetch the missing git ref/timeline automatically for you but to assess what should be done I would really have to get more info about this. Could you try executing the mentioned (in the previous post) commands on your CI and paste in the results?

@akphi
Copy link
Contributor

akphi commented Mar 9, 2021

@rohit-gohri fetch won't do it, you need to pull - git pull -f origin master:master
@Andarist I have added the steps for the 4 commands you asked for:

git pull -f origin master:master # this needs to be run first else the other ones won't even show up
git merge-base master HEAD
git merge-base origin/master HEAD
git branch -r

https://github.com/akphi/config-tester/pull/76/checks?check_run_id=2067446422

@rohit-gohri
Copy link
Contributor

As mentioned in the previous post - I'm still surprised that you both don't get your base branches fetched with fetch-depth: 0 though as the source code of the checkout action explicitly mentions that it should be fetched.

From the the logs for the checkout action, it actually does fetch all the branches:

   * [new branch]      develop                                  -> origin/develop
   * [new branch]      feature/versioning               		-> origin/feature/versioning
   * [new branch]      main                                     -> origin/main

Will try the other commands tomorrow and report back

@Andarist
Copy link
Member

Andarist commented Mar 9, 2021

@akhpi so even git branch -r doesn't return anything if you don't make that git pull -f origin master:master?

@rohit-gohri you are right, I can find similar entries in @akphi's logs. This makes the whole thing even more strange

@Andarist
Copy link
Member

Andarist commented Mar 9, 2021

@akphi could you push out a version without that extra git pull -f origin master:master? Can't find such on the list here: https://github.com/akphi/config-tester/actions

@nategreen
Copy link
Author

@Andarist Ah. Sorry, I grabbed the log only from the step responsible for git checkout. Here's the full (well mostly full) log.

2021-03-09T16:08:04.1095048Z ##[section]Starting: Job
2021-03-09T16:08:04.2938240Z ##[section]Starting: Initialize job
2021-03-09T16:08:04.2939337Z Agent name: 'Hosted Agent'
2021-03-09T16:08:04.2939647Z Agent machine name: 'fv-az113-375'
2021-03-09T16:08:04.2939846Z Current agent version: '2.183.1'
2021-03-09T16:08:04.2980528Z ##[group]Operating System
2021-03-09T16:08:04.2980730Z Ubuntu
2021-03-09T16:08:04.2980861Z 20.04.2
2021-03-09T16:08:04.2980969Z LTS
2021-03-09T16:08:04.2981087Z ##[endgroup]
2021-03-09T16:08:04.2981229Z ##[group]Virtual Environment
2021-03-09T16:08:04.2981415Z Environment: ubuntu-20.04
2021-03-09T16:08:04.2981568Z Version: 20210302.0
2021-03-09T16:08:04.2981835Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20210302.0/images/linux/Ubuntu2004-README.md
2021-03-09T16:08:04.2982186Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F
2021-03-09T16:08:04.2982416Z ##[endgroup]
2021-03-09T16:08:04.2983266Z Current image version: '20210302.0'
2021-03-09T16:08:04.2985307Z Agent running as: 'vsts'
2021-03-09T16:08:04.3023224Z Prepare build directory.
2021-03-09T16:08:04.3248552Z Set build variables.
2021-03-09T16:08:04.3277930Z Download all required tasks.
2021-03-09T16:08:04.3381054Z Downloading task: NodeTool (0.179.1)
2021-03-09T16:08:06.2763170Z Downloading task: Bash (3.182.0)
2021-03-09T16:08:06.4866816Z Downloading task: Cache (2.0.1)
2021-03-09T16:08:06.6730712Z Downloading task: PublishTestResults (2.180.0)
2021-03-09T16:08:07.2980537Z Downloading task: PublishCodeCoverageResults (1.182.0)
2021-03-09T16:08:08.7622597Z Downloading task: PublishBuildArtifacts (1.183.0)
2021-03-09T16:08:09.0705197Z Checking job knob settings.
2021-03-09T16:08:09.0712902Z    Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
2021-03-09T16:08:09.0713756Z    Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
2021-03-09T16:08:09.0714298Z Finished checking job knob settings.
2021-03-09T16:08:09.1017762Z Start tracking orphan processes.
2021-03-09T16:08:09.1166368Z ##[section]Finishing: Initialize job
2021-03-09T16:08:09.1374536Z ##[section]Starting: Checkout mri-design-system@refs/pull/3619/merge to s
2021-03-09T16:08:09.1562820Z ==============================================================================
2021-03-09T16:08:09.1563303Z Task         : Get sources
2021-03-09T16:08:09.1563668Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-03-09T16:08:09.1563913Z Version      : 1.0.0
2021-03-09T16:08:09.1564188Z Author       : Microsoft
2021-03-09T16:08:09.1564653Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2021-03-09T16:08:09.1564953Z ==============================================================================
2021-03-09T16:08:09.5125839Z Syncing repository: mri-design-system (Git)
2021-03-09T16:08:09.5800575Z ##[command]git version
2021-03-09T16:08:09.6187843Z git version 2.30.1
2021-03-09T16:08:09.6233716Z ##[command]git lfs version
2021-03-09T16:08:09.8160775Z git-lfs/2.13.2 (GitHub; linux amd64; go 1.15.5)
2021-03-09T16:08:09.8349109Z ##[command]git init "/home/vsts/work/1/s"
2021-03-09T16:08:09.8411229Z hint: Using 'master' as the name for the initial branch. This default branch name
2021-03-09T16:08:09.8412082Z hint: is subject to change. To configure the initial branch name to use in all
2021-03-09T16:08:09.8412683Z hint: of your new repositories, which will suppress this warning, call:
2021-03-09T16:08:09.8413304Z hint: 
2021-03-09T16:08:09.8414455Z hint: 	git config --global init.defaultBranch <name>
2021-03-09T16:08:09.8414772Z hint: 
2021-03-09T16:08:09.8415262Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2021-03-09T16:08:09.8415888Z hint: 'development'. The just-created branch can be renamed via this command:
2021-03-09T16:08:09.8416207Z hint: 
2021-03-09T16:08:09.8416561Z hint: 	git branch -m <name>
2021-03-09T16:08:09.8424891Z Initialized empty Git repository in /home/vsts/work/1/s/.git/
2021-03-09T16:08:09.8443223Z ##[command]git remote add origin https://[email protected]/mrisoftware/MRI_Platform/_git/mri-design-system
2021-03-09T16:08:09.8502911Z ##[command]git config gc.auto 0
2021-03-09T16:08:09.8550190Z ##[command]git config --get-all http.https://[email protected]/mrisoftware/MRI_Platform/_git/mri-design-system.extraheader
2021-03-09T16:08:09.8574043Z ##[command]git config --get-all http.proxy
2021-03-09T16:08:09.8617479Z ##[command]git config http.version HTTP/1.1
2021-03-09T16:08:09.8713023Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/pull/3619/merge:refs/remotes/pull/3619/merge
2021-03-09T16:08:10.8275229Z remote: Azure Repos        
2021-03-09T16:08:10.8276747Z remote: 
2021-03-09T16:08:10.8278065Z remote: Found 18407 objects to send. (149 ms)        
2021-03-09T16:08:10.8292948Z Receiving objects:   0% (1/18407)
2021-03-09T16:08:10.8299267Z Receiving objects:   1% (185/18407)
2021-03-09T16:08:11.2241836Z Receiving objects:   2% (369/18407)
2021-03-09T16:08:11.2265496Z Receiving objects:   3% (553/18407), 3.94 MiB | 6.91 MiB/s
2021-03-09T16:08:11.2288321Z Receiving objects:   4% (737/18407), 3.94 MiB | 6.91 MiB/s
2021-03-09T16:08:11.2414428Z Receiving objects:   5% (921/18407), 3.94 MiB | 6.91 MiB/s
...
2021-03-09T16:08:11.6283459Z Receiving objects:  98% (18039/18407), 3.94 MiB | 6.91 MiB/s
2021-03-09T16:08:11.6291086Z Receiving objects:  99% (18223/18407), 3.94 MiB | 6.91 MiB/s
2021-03-09T16:08:11.6291667Z Receiving objects: 100% (18407/18407), 3.94 MiB | 6.91 MiB/s
2021-03-09T16:08:11.6292198Z Receiving objects: 100% (18407/18407), 15.62 MiB | 14.62 MiB/s, done.
2021-03-09T16:08:11.6366133Z Resolving deltas:   0% (0/10237)
2021-03-09T16:08:11.6516075Z Resolving deltas:   1% (103/10237)
2021-03-09T16:08:11.6619492Z Resolving deltas:   2% (205/10237)
...
2021-03-09T16:08:12.0149425Z Resolving deltas:  98% (10033/10237)
2021-03-09T16:08:12.0338765Z Resolving deltas:  99% (10135/10237)
2021-03-09T16:08:12.0339785Z Resolving deltas: 100% (10237/10237)
2021-03-09T16:08:12.0340691Z Resolving deltas: 100% (10237/10237), done.
2021-03-09T16:08:12.3107519Z From https://dev.azure.com/mrisoftware/MRI_Platform/_git/mri-design-system
2021-03-09T16:08:12.3108189Z  * [new branch]      Adding-kendo-grid-styles    -> origin/Adding-kendo-grid-styles
2021-03-09T16:08:12.3133700Z  * [new branch]      action-menu                 -> origin/action-menu
2021-03-09T16:08:12.3135919Z  * [new branch]      add-args-to-publish         -> origin/add-args-to-publish
2021-03-09T16:08:12.3136552Z  * [new branch]      add-css-to-styles-packages  -> origin/add-css-to-styles-packages
... (all branches)
2021-03-09T16:08:12.3332857Z  * [new branch]      use-kendo-label-instead-of-k-label -> origin/use-kendo-label-instead-of-k-label
2021-03-09T16:08:12.3333432Z  * [new branch]      validation-states           -> origin/validation-states
2021-03-09T16:08:12.3333943Z  * [new ref]         refs/pull/3619/merge        -> pull/3619/merge
2021-03-09T16:08:12.3334482Z  * [new tag]         @mri/[email protected]  -> @mri/[email protected]
2021-03-09T16:08:12.3335049Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
2021-03-09T16:08:12.3335629Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
2021-03-09T16:08:12.3336224Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
... (all tags)
2021-03-09T16:08:12.3589902Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
2021-03-09T16:08:12.3590462Z  * [new tag]         @mri/[email protected] -> @mri/[email protected]
2021-03-09T16:08:12.3590977Z  * [new tag]         v0.3.0-pre.0                -> v0.3.0-pre.0
2021-03-09T16:08:12.4150654Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin +180c56225d7d613afeb10e1539c36eaafb59c049:refs/remotes/origin/180c56225d7d613afeb10e1539c36eaafb59c049
2021-03-09T16:08:12.5983804Z From https://dev.azure.com/mrisoftware/MRI_Platform/_git/mri-design-system
2021-03-09T16:08:12.5988084Z  * [new ref]           180c56225d7d613afeb10e1539c36eaafb59c049 -> origin/180c56225d7d613afeb10e1539c36eaafb59c049
2021-03-09T16:08:12.6960175Z ##[command]git checkout --progress --force refs/remotes/pull/3619/merge
2021-03-09T16:08:12.8229559Z Note: switching to 'refs/remotes/pull/3619/merge'.
2021-03-09T16:08:12.8229747Z 
2021-03-09T16:08:12.8230225Z You are in 'detached HEAD' state. You can look around, make experimental
2021-03-09T16:08:12.8230586Z changes and commit them, and you can discard any commits you make in this
2021-03-09T16:08:12.8230950Z state without impacting any branches by switching back to a branch.
2021-03-09T16:08:12.8231119Z 
2021-03-09T16:08:12.8231370Z If you want to create a new branch to retain commits you create, you may
2021-03-09T16:08:12.8231905Z do so (now or later) by using -c with the switch command. Example:
2021-03-09T16:08:12.8232117Z 
2021-03-09T16:08:12.8232452Z   git switch -c <new-branch-name>
2021-03-09T16:08:12.8232576Z 
2021-03-09T16:08:12.8232787Z Or undo this operation with:
2021-03-09T16:08:12.8232930Z 
2021-03-09T16:08:12.8233220Z   git switch -
2021-03-09T16:08:12.8233318Z 
2021-03-09T16:08:12.8233580Z Turn off this advice by setting config variable advice.detachedHead to false
2021-03-09T16:08:12.8233778Z 
2021-03-09T16:08:12.8240418Z HEAD is now at 180c5622 Merge pull request 3619 from debug-changesets-git into master
2021-03-09T16:08:12.8251657Z ##[command]git config http.https://[email protected]/mrisoftware/MRI_Platform/_git/mri-design-system.extraheader "AUTHORIZATION: bearer ***"
2021-03-09T16:08:12.8491210Z ##[section]Finishing: Checkout mri-design-system@refs/pull/3619/merge to s
2021-03-09T16:08:12.8515781Z ##[section]Starting: Install Node.js
2021-03-09T16:08:12.8522128Z ==============================================================================
2021-03-09T16:08:12.8522405Z Task         : Node.js tool installer
2021-03-09T16:08:12.8522735Z Description  : Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH
2021-03-09T16:08:12.8523016Z Version      : 0.179.1
2021-03-09T16:08:12.8523229Z Author       : Microsoft Corporation
2021-03-09T16:08:12.8523516Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/node-js
2021-03-09T16:08:12.8523846Z ==============================================================================
2021-03-09T16:08:13.4265355Z Found tool in cache: node 12.21.0 x64
2021-03-09T16:08:13.4268226Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/node/12.21.0/x64/bin
2021-03-09T16:08:13.4691463Z ##[section]Finishing: Install Node.js
2021-03-09T16:08:13.4712777Z ##[section]Starting: Install CLI tools
2021-03-09T16:08:13.4719109Z ==============================================================================
2021-03-09T16:08:13.4719369Z Task         : Bash
2021-03-09T16:08:13.4719617Z Description  : Run a Bash script on macOS, Linux, or Windows
2021-03-09T16:08:13.4719840Z Version      : 3.182.0
2021-03-09T16:08:13.4720043Z Author       : Microsoft Corporation
2021-03-09T16:08:13.4720340Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2021-03-09T16:08:13.4720662Z ==============================================================================
2021-03-09T16:08:13.5912488Z Generating script.
2021-03-09T16:08:13.5923464Z Script contents:
2021-03-09T16:08:13.5924005Z npm i -g pnpm @changesets/cli
2021-03-09T16:08:13.5933688Z ========================== Starting Command Output ===========================
2021-03-09T16:08:13.5944530Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/57703654-7413-461e-ae77-e59cb798a943.sh
2021-03-09T16:08:22.6570931Z npm WARN deprecated [email protected]: Backported compatibility to node > 6
2021-03-09T16:08:25.4481705Z /opt/hostedtoolcache/node/12.21.0/x64/bin/changeset -> /opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/bin.js
2021-03-09T16:08:25.4491890Z /opt/hostedtoolcache/node/12.21.0/x64/bin/pnpm -> /opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/pnpm/bin/pnpm.js
2021-03-09T16:08:25.4492989Z /opt/hostedtoolcache/node/12.21.0/x64/bin/pnpx -> /opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/pnpm/bin/pnpx.js
2021-03-09T16:08:25.4985743Z + @changesets/[email protected]
2021-03-09T16:08:25.4986768Z + [email protected]
2021-03-09T16:08:25.4987066Z added 229 packages from 201 contributors in 11.063s
2021-03-09T16:08:25.6895323Z ##[section]Finishing: Install CLI tools
2021-03-09T16:08:25.6915949Z ##[section]Starting: Cache PNPM package store
2021-03-09T16:08:25.6922370Z ==============================================================================
2021-03-09T16:08:25.6922629Z Task         : Cache
2021-03-09T16:08:25.6922850Z Description  : Cache files between runs
2021-03-09T16:08:25.6923041Z Version      : 2.0.1
2021-03-09T16:08:25.6923242Z Author       : Microsoft Corporation
2021-03-09T16:08:25.6923499Z Help         : https://aka.ms/pipeline-caching-docs
2021-03-09T16:08:25.6923785Z ==============================================================================
2021-03-09T16:08:25.9681657Z Resolving key:
2021-03-09T16:08:25.9816940Z  - pnpm           [string]
2021-03-09T16:08:25.9821384Z  - "Linux"        [string]
2021-03-09T16:08:26.0239149Z  - pnpm-lock.yaml [file] --> A9AB65E7FFAE9072CF913941F201C3FF4DF57A9713A9D2646B3A4E288290075D
2021-03-09T16:08:26.0271841Z Resolved to: pnpm|"Linux"|ECAtGPChfgq9Bm0xMtVDdAs43Av8gJBrwL7XBtHg8oI=
2021-03-09T16:08:26.0332125Z Resolving restore key:
2021-03-09T16:08:26.0332997Z  - pnpm    [string]
2021-03-09T16:08:26.0333407Z  - "Linux" [string]
2021-03-09T16:08:26.0337397Z Resolved to: pnpm|"Linux"|**
2021-03-09T16:08:26.0337702Z Resolving restore key:
2021-03-09T16:08:26.0338145Z  - pnpm [string]
2021-03-09T16:08:26.0338424Z Resolved to: pnpm|**
2021-03-09T16:08:26.9593089Z ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 22b20757-2ab7-4074-abd6-834261e24a3f
2021-03-09T16:08:27.4408352Z Getting a pipeline cache artifact with one of the following fingerprints:
2021-03-09T16:08:27.4408851Z Fingerprint: `pnpm|"Linux"|ECAtGPChfgq9Bm0xMtVDdAs43Av8gJBrwL7XBtHg8oI=`
2021-03-09T16:08:27.4409191Z Fingerprint: `pnpm|"Linux"|**`
2021-03-09T16:08:27.4409442Z Fingerprint: `pnpm|**`
2021-03-09T16:08:28.6463878Z There is a cache miss.
2021-03-09T16:08:30.0495057Z ApplicationInsightsTelemetrySender correlated 1 events with X-TFS-Session 22b20757-2ab7-4074-abd6-834261e24a3f
2021-03-09T16:08:30.0557303Z ##[section]Finishing: Cache PNPM package store
2021-03-09T16:08:30.0587543Z ##[section]Starting: Install packages
2021-03-09T16:08:30.0594711Z ==============================================================================
2021-03-09T16:08:30.0594969Z Task         : Bash
2021-03-09T16:08:30.0595201Z Description  : Run a Bash script on macOS, Linux, or Windows
2021-03-09T16:08:30.0595437Z Version      : 3.182.0
2021-03-09T16:08:30.0595641Z Author       : Microsoft Corporation
2021-03-09T16:08:30.0595939Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2021-03-09T16:08:30.0596260Z ==============================================================================
2021-03-09T16:08:30.1729272Z Generating script.
2021-03-09T16:08:30.1740098Z Script contents:
2021-03-09T16:08:30.1740832Z pnpm install -r
2021-03-09T16:08:30.1750341Z ========================== Starting Command Output ===========================
2021-03-09T16:08:30.1761304Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/16ae91dd-a7b8-47d9-b92b-6f079bd5e661.sh
2021-03-09T16:08:30.6458631Z Scope: all 23 workspace projects
2021-03-09T16:08:30.7864861Z Lockfile is up-to-date, resolution step is skipped
2021-03-09T16:08:30.9374687Z Progress: resolved 1, reused 0, downloaded 0, added 0
2021-03-09T16:08:31.5714243Z .                                        |    +3117 ++++++++++++++++++++++++++++
2021-03-09T16:08:31.9380914Z Progress: resolved 3117, reused 0, downloaded 0, added 0
2021-03-09T16:08:32.5921611Z Progress: resolved 3117, reused 0, downloaded 1, added 0
2021-03-09T16:08:32.6105226Z Packages are hard linked from the content-addressable store to the virtual store.
2021-03-09T16:08:32.6106680Z   Content-addressable store is at: /home/vsts/work/1/s/.pnpm-store/v3
2021-03-09T16:08:32.6107619Z   Virtual store is at:             node_modules/.pnpm
2021-03-09T16:08:33.5932648Z Progress: resolved 3117, reused 0, downloaded 16, added 16
2021-03-09T16:08:33.6532357Z Progress: resolved 3117, reused 0, downloaded 17, added 16
2021-03-09T16:08:34.6537138Z Progress: resolved 3117, reused 0, downloaded 45, added 45
... (install and run all postinstall tasks...)
2021-03-09T16:10:07.4587398Z .../node_modules/@compodoc/compodoc postinstall: > https://opencollective.com/compodoc/donate
2021-03-09T16:10:07.4615405Z .../node_modules/@compodoc/compodoc postinstall: Done
2021-03-09T16:10:09.1689955Z ##[section]Finishing: Install packages
2021-03-09T16:10:09.1717255Z ##[section]Starting: Check for changesets
2021-03-09T16:10:09.1724932Z ==============================================================================
2021-03-09T16:10:09.1725203Z Task         : Bash
2021-03-09T16:10:09.1725445Z Description  : Run a Bash script on macOS, Linux, or Windows
2021-03-09T16:10:09.1726295Z Version      : 3.182.0
2021-03-09T16:10:09.1726518Z Author       : Microsoft Corporation
2021-03-09T16:10:09.1726804Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2021-03-09T16:10:09.1727126Z ==============================================================================
2021-03-09T16:10:09.2988744Z Generating script.
2021-03-09T16:10:09.3005302Z Script contents:
2021-03-09T16:10:09.3006181Z changeset status
2021-03-09T16:10:09.3020156Z ========================== Starting Command Output ===========================
2021-03-09T16:10:09.3036631Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/8ffe34b3-2b00-4584-8c6e-8853809922fd.sh
2021-03-09T16:10:09.7141721Z Package "@mri/scss-messages" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7142780Z Package "@mri/scss-overlays" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7612159Z Package "@mri/scss-messages" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7618430Z Package "@mri/scss-overlays" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7691813Z Package "@mri/scss-messages" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7697281Z Package "@mri/scss-overlays" must depend on the current version of "@mri/theme-default": "1.0.2" vs "^0.1.0"
2021-03-09T16:10:09.7789569Z 🦋  error Error: Failed to find where HEAD diverged from master. Does master exist?
2021-03-09T16:10:09.7790891Z 🦋  error     at getDivergedCommit (/opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:58:11)
2021-03-09T16:10:09.7792030Z 🦋  error     at async getChangedFilesSince (/opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:169:22)
2021-03-09T16:10:09.7793207Z 🦋  error     at async Object.getChangedPackagesSinceRef (/opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/node_modules/@changesets/git/dist/git.cjs.dev.js:208:24)
2021-03-09T16:10:09.7794178Z 🦋  error     at async getStatus (/opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/dist/cli.cjs.dev.js:957:27)
2021-03-09T16:10:09.7795049Z 🦋  error     at async run$1 (/opt/hostedtoolcache/node/12.21.0/x64/lib/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1203:11)
2021-03-09T16:10:09.7930624Z ##[error]Bash exited with code '1'.
2021-03-09T16:10:09.8002702Z ##[section]Finishing: Check for changesets
2021-03-09T16:10:09.8105778Z ##[section]Starting: Move documentation to pull request directory
2021-03-09T16:10:09.8112645Z ==============================================================================
2021-03-09T16:10:09.8112900Z Task         : Bash
2021-03-09T16:10:09.8113149Z Description  : Run a Bash script on macOS, Linux, or Windows
2021-03-09T16:10:09.8113385Z Version      : 3.182.0
2021-03-09T16:10:09.8113588Z Author       : Microsoft Corporation
2021-03-09T16:10:09.8113872Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2021-03-09T16:10:09.8114209Z ==============================================================================
2021-03-09T16:10:09.9255999Z Generating script.
2021-03-09T16:10:09.9282376Z ========================== Starting Command Output ===========================
2021-03-09T16:10:09.9294826Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/49346d8c-a08a-4a6a-89d5-46a64d14296b.sh
2021-03-09T16:10:09.9396575Z mv: cannot stat '/home/vsts/work/1/s/.generated-docs/*': No such file or directory
2021-03-09T16:10:09.9408463Z mkdir: cannot create directory ‘/home/vsts/work/1/s/.generated-docs/3619/’: No such file or directory
2021-03-09T16:10:09.9422872Z mv: cannot stat '/home/vsts/work/1/s/.generated-docs-temp/*': No such file or directory
2021-03-09T16:10:09.9450942Z ##[error]Bash exited with code '1'.
2021-03-09T16:10:09.9479845Z ##[section]Finishing: Move documentation to pull request directory
2021-03-09T16:10:09.9512999Z ##[section]Starting: Cache PNPM package store
2021-03-09T16:10:09.9517118Z ==============================================================================
2021-03-09T16:10:09.9517360Z Task         : Cache
2021-03-09T16:10:09.9517571Z Description  : Cache files between runs
2021-03-09T16:10:09.9517766Z Version      : 2.0.1
2021-03-09T16:10:09.9517952Z Author       : Microsoft Corporation
2021-03-09T16:10:09.9518195Z Help         : https://aka.ms/pipeline-caching-docs
2021-03-09T16:10:09.9518476Z ==============================================================================
2021-03-09T16:10:10.2307190Z ##[section]Finishing: Cache PNPM package store
2021-03-09T16:10:10.2324071Z ##[section]Starting: Checkout mri-design-system@refs/pull/3619/merge to s
2021-03-09T16:10:10.2327463Z ==============================================================================
2021-03-09T16:10:10.2327717Z Task         : Get sources
2021-03-09T16:10:10.2327984Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-03-09T16:10:10.2328257Z Version      : 1.0.0
2021-03-09T16:10:10.2328424Z Author       : Microsoft
2021-03-09T16:10:10.2328716Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2021-03-09T16:10:10.2329058Z ==============================================================================
2021-03-09T16:10:10.5185041Z Cleaning any cached credential from repository: mri-design-system (Git)
2021-03-09T16:10:10.5389739Z ##[command]git version
2021-03-09T16:10:10.5682853Z git version 2.30.1
2021-03-09T16:10:10.5743051Z ##[command]git lfs version
2021-03-09T16:10:10.5834068Z git-lfs/2.13.2 (GitHub; linux amd64; go 1.15.5)
2021-03-09T16:10:10.5865540Z ##[command]git config --unset-all http.https://[email protected]/mrisoftware/MRI_Platform/_git/mri-design-system.extraheader
2021-03-09T16:10:10.6080129Z ##[section]Finishing: Checkout mri-design-system@refs/pull/3619/merge to s
2021-03-09T16:10:10.6130651Z ##[section]Starting: Finalize Job
2021-03-09T16:10:10.6159214Z Cleaning up task key
2021-03-09T16:10:10.6160428Z Start cleaning up orphan processes.
2021-03-09T16:10:10.6332943Z ##[section]Finishing: Finalize Job
2021-03-09T16:10:10.6370285Z ##[section]Finishing: Job

@akphi
Copy link
Contributor

akphi commented Mar 10, 2021

@Andarist git branch -r works! Anyhow, I did all 4 scenarios here:
akphi/config-tester#76

With `git pull`
No `git pull` and call `git merge-base master`
No `git pull` and call `git branch -r`
No `git pull` and call `git merge-base origin/master`

Looks like git merge-base origin/master is the good call here, should we then try to call since=origin/master instead?

@Andarist
Copy link
Member

Ok, I think I somewhat know what to do for the @akhpi case - although the logs from git are somewhat inconsistent in a couple of places there.

I'm still not 100% sure what to do in the @nategreen's case - could you check what git branch and git branch -r returns for you there? I suspect that both lists are somewhat empty-ish but I'd like to confirm that first.

@ilchenkoArtem
Copy link

ilchenkoArtem commented Mar 21, 2021

Hello. I have it problem too after run yarn changeset. I have master branch in my repository.

Error:

�  error Error: Failed to find where HEAD diverged from master. Does master exist?
�  error     at getDivergedCommit (D:\myProject\styled-full-css-grid-2\node_modules\@changesets\git\dist\git.cjs.dev.js:58:11)
�  error     at processTicksAndRejections (internal/process/task_queues.js:93:5)
�  error     at async getChangedFilesSince (D:\myProject\styled-full-css-grid-2\node_modules\@changesets\git\dist\git.cjs.dev.js:169:22)
�  error     at async Object.getChangedPackagesSinceRef (D:\myProject\styled-full-css-grid-2\node_modules\@changesets\git\dist\git.cjs.dev.js:208:24)
�  error     at async add (D:\myProject\styled-full-css-grid-2\node_modules\@changesets\cli\dist\cli.cjs.dev.js:409:29)
�  error     at async run$1 (D:\myProject\styled-full-css-grid-2\node_modules\@changesets\cli\dist\cli.cjs.dev.js:1096:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
//config.json
{
  "$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "linked": [],
  "access": "restricted",
  "baseBranch": "master",
  "updateInternalDependencies": "patch",
  "ignore": []
}

git --version // git version 2.22.0.windows.1
yarn -v //1.22.5
node -v //v14.15.5

@Andarist
Copy link
Member

@tema1411 could you tell me how exactly do you fetch your repository/commit/pr? please look through the existing comments here to get a better feeling as to what possible explanations can be

@rohit-gohri
Copy link
Contributor

Maybe we can log the actual error thrown by git here: https://github.com/atlassian/changesets/blob/eae72367e9cb8e708a1d441770dbc70930d4e1ad/packages/git/src/index.ts#L39-L44

cmd.stderr can be logged in debug mode?

@rohit-gohri
Copy link
Contributor

rohit-gohri commented Apr 5, 2021

This is what finally fixed it for me:

name: Node.js CI

on:
  push:
    branches: [develop, main]
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v1
        with:
          node-version: 12

      - run: npm ci

      - run: |
          # Checkout PR head commit instead of merge commit
          # See: https://github.com/atlassian/changesets/issues/517
          git checkout ${{ github.event.pull_request.head.sha }}
          npx changeset status --since=origin/main
        if: ${{ github.event_name == 'pull_request' }}

According to https://github.jparrowsec.cnmunity/t/running-git-merge-base-fork-point-master-command-as-part-of-a-job-fails/18212/2 git merge-base fails if the branch has already been merged before. And github pull_request events uses a merge commit to run the pipeline instead of the PR head.

So I added a git checkout ${{ github.event.pull_request.head.sha }} command before running changeset.

@Andarist
Copy link
Member

Andarist commented Apr 5, 2021

git merge-base fails if the branch has already been merged before. And github pull_request events uses a merge commit to run the pipeline instead of the PR head.

wow, that's a nice finding! I think the whole thing can/should be just fixed on our side but I don't have much time to focus on this one right now properly to implement the fix.

@rohit-gohri
Copy link
Contributor

I think getChangedFilesSince can be implemented like danger-js does it : https://github.com/danger/danger-js/blob/main/source/platforms/git/localGetDiff.ts

Use git diff ${since}...HEAD and then use parse-diff to parse it and find modified files like in : https://github.com/danger/danger-js/blob/main/source/platforms/git/gitJSONToGitDSL.ts

@Andarist
Copy link
Member

Andarist commented Apr 5, 2021

This could fix the issue mentioned in your comment but there are other ones mentioned in this thread and this would not fix them as in those cases "since" is an unknown ref (it has not been fetched at all).

@elpddev
Copy link

elpddev commented Jun 11, 2021

Thanks to the comments in this issue and others, I had success checking for changeset existence in a PR.

If I understood correctly, github action checkout@v2 only checkout a newly created merged commit that is the result of the PR branch head commit and the target commit. This throw off the changeset status --from command since the target commit/branch does not exists in the clone the github checkout action do.

To solve this:

  1. I fetch the origin PR commit and the base (PR target) commit.
  2. Afterward, I checkout to the PR commit because changeset status seems to not be able to compare the merged commit with the base commit. I did not investigate further.
  3. After running the changeset status check, I restore the current working directory and checkout the PR merged commit.
  git fetch origin ${GITHUB_HEAD_REF}
  git fetch origin ${GITHUB_BASE_REF}
  git checkout ${GITHUB_HEAD_REF}
  yarn changeset status --since=origin/${GITHUB_BASE_REF}
  git checkout ${GITHUB_SHA}

@elisechant
Copy link

elisechant commented Jul 22, 2021

I believe this is a compat issue with Github Check Action v2 and changeset status, specifically:

  • Creates a local branch - No longer detached HEAD when checking out a branch
  • Improved performance - Fetches only a single commit by default

In case this is helpful to others, this works for me:

- name: Check out repository code
  uses: actions/checkout@v1
  with:
    fetch-depth: 0

// ... install node, yarn install

- name: Check for Changesets
  run: |
    git pull -f origin main:main
    yarn changeset status --since=main

@lpoulter
Copy link

lpoulter commented Oct 22, 2021

Any update on this? The following was working for me but it stopped recently and fails with the error fatal: Need to specify how to reconcile divergent branches..

  run: |
    git pull -f origin main:main
    yarn changeset status --since=main

@Andarist
Copy link
Member

It would be great if one could share a repro case with me - that way I could do my own experiments on it to see what would be the most viable solution for the problem. And it would be best if somebody would just prepare a PR with the fix 😉 I'm just a human - I'm as capable to fix/investigate this as any of you.

@will-stone
Copy link

For anyone struggling with this in GitLab, I ended up using this in my job:

  script:
    # Required so that Changesets can compare with main branch
    - git config --global --add safe.directory /builds/path/to/project-name
    - git pull -f origin main:main
    - npx changeset status

Please let me know if there's any major downsides to this approach that I am not aware of 😬

@steve-taylor
Copy link

steve-taylor commented Jul 12, 2022

For those of you struggling with this in GitHub Actions workflows triggered by pull requests, here's what works for me:

  1. Check out the branch rather than the result of merging main into your branch. Also get the full commit history.
    uses: actions/checkout@v3
    with:
      ref: ${{github.event.pull_request.head.sha}}
      fetch-depth: 0
  2. The workflow runner hasn't checked out main locally, so refer to it as origin/main in the changeset status command.
    run: npx changeset status --since origin/main

@airtonix
Copy link

for processing changesets on your mainline branch push event:

name: Process Changesets

description: |
  If any changsets are found in the .changeset/ directory - they'll be
  processed into CHANGELOGs and declared packages will have their
  version fields bumped.

runs:
  using: 'composite'

  steps:
    # reasons: https://github.com/changesets/changesets/issues/517
    - name: grab master branch
      shell: bash
      run: |
        git checkout ${{github.sha}}

    - name: Check for changesets
      shell: bash
      id: check-for-changesets
      run: echo "::set-output name=HasChangesets::$(pnpm run changeset -- status && echo 'true' || echo 'false')"

    - name: Process changesets
      if: steps.check-for-changesets.outputs.HasChangesets != 'false'
      shell: bash
      run: pnpm changeset -- version

    - name: 📜 Changesets created the following updates
      if: steps.check-for-changesets.outputs.HasChangesets != 'false'
      shell: bash
      run: git diff-tree --no-commit-id --name-only -r HEAD

    - name: 📲 Pulling any updates
      if: steps.check-for-changesets.outputs.HasChangesets != 'false'
      shell: bash
      run: git pull --no-edit origin ${{ github.ref_name }}

    - name: 🚚 Pushing new changes
      if: steps.check-for-changesets.outputs.HasChangesets != 'false'
      shell: bash
      run: git push origin ${{ github.ref_name }}

🤝 👍🏻

@glasser
Copy link
Contributor

glasser commented Aug 9, 2022

It seems like there are two different things that can cause the issue:

  • git clone'ing in a way that doesn't fetch the master refer (to origin/master) at all
  • git clone'ing all the refs, but not actually creating a local branch

If you're having the second problem (which I am, on CircleCI not GH Actions), it looks like there's a much simpler solution: just pass --since=origin/master instead of master.

Another thought would be to put origin/master as the baseBranch in config.json. As far as I can tell from a quick glance in the source, the only thing the tool ever actually does with baseBranch is pass it to git merge-base BASE_BRANCH HEAD, which can be any ref, not just a branch, so this seems fine. (If it did things like check out the given baseBranch, that would be tougher.) This does have the downside of breaking for users who choose a different remote name locally, though.

@kachkaev
Copy link

kachkaev commented Sep 7, 2022

My solution for PR CI: https://github.com/blockprotocol/blockprotocol/blob/f5e7748c1c2d5d114eb28241a3912ff4a1f8b6c9/.github/workflows/ci.yml#L19-L41

In essence:

- uses: actions/checkout@v3
  with:
    fetch-depth: 0 ## Needed for Changesets to find `main` branch

- if: ${{ github.event.pull_request.title != 'Version Packages' }}
  run: git pull --force --no-tags origin main:main

## yarn install etc.

- if: ${{ github.event.pull_request.title != 'Version Packages' }}
  run:  yarn changeset status

Adding --no-tags to git pull makes command output less verbose, so Changesets report is surrounded with less noise. It’s also possible to forward the output of git pull to /dev/null but not sure if it’s worth it.

Running yarn changeset status in Version Packages PRs does not work, according to docs and own experience:

NOTE: status will fail if you are in the middle of running version or publish. If you want to get changeset status at the time of a version increase and publish, you need to run it immediately before running version.

@clChenLiang
Copy link

Maybe just not have the local main branch

@alexbakers
Copy link

$ git merge-base master HEAD
fatal: Not a valid object name master
$ git pull -f origin master:master
fatal: couldn't find remote ref master
$ git merge-base origin/master HEAD
fatal: Not a valid object name origin/master
$ git branch -r
  origin/HEAD -> origin/develop
  origin/develop

@lsliwaradioluz
Copy link

I can confirm using

npx @changesets/cli status --since origin/main

worked for me on Github

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

No branches or pull requests