question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`changeset status` succeeds locally, fails in CI with a changeset file verifiably present

See original GitHub issue

Affected Packages

cli

"version": "2.18.1",

Problem

I have a monorepo of related packages and yarn changeset status succeeds locally, but fails in CI (azure devops). There is definitely a changeset file present in the ADO workspace.

Before I try

yarn changeset status

I am testing using just

ls -la

to make sure the files actually exist:

image

and in the .changeset folder: image

So i KNOW the changeset file exists. I generated it with a standard

yarn changeset add

However, when I run

yarn changeset status

right after those ls commands, i get:

image

I’ve also tried

yarn changeset status --since="origin/main"

since main is my baseBranch. When i run that, the error is different:

image

Here is my config.json:

{
  "$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
  "changelog": "@changesets/cli/changelog",
  "commit": true,
  "linked": [],
  "access": "restricted",
  "baseBranch": "main",
  "updateInternalDependencies": "minor",
  "ignore": ["@<scope>/docs", "@<scope>/playroom", "@<scope>/private-playroom"]
}

This CI job is running ON a merge of the main branch. So the --since= I would think isnt necessary, but i can’t run the status command without origin/main because for some reason changesets cant find the main branch?

Any idea what is happening here? I do want to check for changesets, even an empty one in my CI at least for the time being until we get used to our deployment cadences and figure out better how and when we need changesets.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Andaristcommented, Dec 8, 2021

My bet is that you are using some kind of shallow cloning there, on the CI, and changeset status can’t access the base branch. A quick solution that could be done on your side would be to fetch it before you call changeset status. Other than that you could help me out to figure out what’s the best solution here - what Changesets behavior should be? What do you think should happen? If the branch is missing locally should we try to get its hash from the remote and fetch the git history between that and the current HEAD?

0reactions
michaelwarren1106commented, Dec 9, 2021

I actually have a question that might be relevant here. BTW thanks a TON for your help!

The way my flow is gonna work is that changesets are going to be created in PRs (there is a changeset status in the PR build also, that seems to work), then when that PR is merged into main another build runs that does mostly the same stuff but has some publishing steps.

This build that i’m referring to is the build for main so its building a detached HEAD of main from the main branch itself. Is changeset status always making sure that the head is detached from the base branch and has different commits? If i’m building main and my --since is also main then there wont be a detach commit point because the commit history of the branch i’m building would be the same as the --since?

If so, should i just NOT check for changesets in the main merge build since i’m checking for them in PR builds and PR branches will have a detach point that is different from main?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CI builds fail with "does master exist?" · Issue #517 - GitHub
@Andarist I have a github action that has a step calling changeset status --since=master . This works locally and fails in the pipeline....
Read more >
How do I resolve change set errors in CloudFormation? - AWS
This error is thrown when an existing resource is modified during a resource import operation. During an import operation, create, update, and ...
Read more >
Roll back changesets - Azure Repos | Microsoft Learn
In the Rollback dialog box, select Rollback changes from a single changeset. Specify the changeset, and then select Rollback.
Read more >
mozilla-release: changeset 517058 ... - Mercurial
LINK], function Anchor_match(aAccessible) { // We want to ignore links, only focus named anchors. if (Utils.getState(aAccessible).contains(States.
Read more >
Full text of "Jenkins: The Definitive Guide" - Internet Archive
Introducing Continuous Integration into Your Organization 5 1.6.1. ... such as the build result log file, the Subversion revision number used for this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found