Git Product home page Git Product logo

Comments (11)

demisx avatar demisx commented on May 22, 2024 3

Just to clarify, I meant addition of this --force flag here: semantic-release/semantic-release@master...beocommedia:force-local-tag-updates.

Not sure if doing so makes sense for everyone. For now, I am just running these on CI before invoking npx semantic-release ... and right before publishing to GitLab. This is not perfect, but minimizes chances of flux repo updates interfering with the semantic-release updates.

git fetch -tp -f --all
git tag -d flux-sync-stg || true
git tag -d flux-sync-prod || true

from git.

pvdlg avatar pvdlg commented on May 22, 2024 2

You shouldn't modify the commits release tags points to. That would completely mess up what semantic-release is doing. semantic-releases uses those tags to figure out what are the new commits since the last release, so if you change those the releases won't happens as intended.

In addition this error is due to the fact that you have a discrepancy between the tags on the remote and the local repo. semantic-release should run on your CI on a freshly cloned repo in which case you shouldn't have discrepancy between the remote and the clone.

I don't know what is your current workflow, but it seems to be something we can't support.

Even if we were to add -f to git fetch --tags that would only remove this error message but wouldn't solve the core issue: you should never change release tags, and your local repo clone should be identical to the remote.

from git.

manjupriyajaintm avatar manjupriyajaintm commented on May 22, 2024 1

Hello community, I just found myself with this problem too, but I just solved it.

Surely when running the "react-native upgrade" command, it gave them the message that it was not necessary to update or with the command "react-native eject" that the command is not recognized.

Now you should use the "react-native upgrade --legacy true" command to back up your android folders or ios as the case may be as this command will replace your files.

Now it's just telling you not to replace your package.json

Greetings.

from git.

pvdlg avatar pvdlg commented on May 22, 2024

Can you provide more details. How do you end up in that situation.
Please provide steps to reproduce.

from git.

moltar avatar moltar commented on May 22, 2024

Flux is a K8s GitOps tool.

It updates the tag to point to the latest release.

So basically just updating a tag to point to a new HEAD is the repro.

from git.

pvdlg avatar pvdlg commented on May 22, 2024

I still have no idea how this related to semantic-release not how to reproduce.
I can't help you if on't provide more details and reproduction steps.

from git.

moltar avatar moltar commented on May 22, 2024

Hi Pierre,

Unfortunately, I cannot create a test environment by hand to reproduce this.

But essentially, what happened is the following.

A third party service force-updates an existing tag, which now points to a different commit than before. This tag was already published.

When semantic-release/git fetches the tags from remote without the -f flag, the error is thrown and the fetch fails.

A way to reproduce would be:

  1. Make a successful release
  2. Add a new tag git tag foo
  3. Create another release later
  4. Update a tag git tag -f foo <-- now points to a different ref
  5. Try to release and it will fail

from git.

moltar avatar moltar commented on May 22, 2024

I am not modifying the semantic release tags though. My example has a foo tag. Real world example was a flux-sync tag.

from git.

pvdlg avatar pvdlg commented on May 22, 2024

Still the problem is you have a discrepancy between your remote and your local repo.
How does that happened?
How do you clone your local repo on the CI?

from git.

pvdlg avatar pvdlg commented on May 22, 2024

Closing as no answer provided

from git.

demisx avatar demisx commented on May 22, 2024

I am having the same issue as @moltar. Once flux updates the remote tag flux-sync-prod after the repo has been already cloned by CI, the semantic-release command git fetch --tags [repositoryUrl] fails to update it with this message (see below). Perhaps the git command is missing the --force flag?

[8:17:54 PM] [semantic-release] › ✖  An error occurred while running semantic-release: { Error: Command failed: git fetch --tags https://gitlab-ci-token:[secure]@[repositoryUrl]
From https://git.[redacted]:
 * branch              HEAD           -> FETCH_HEAD
 ! [rejected]          flux-sync-prod -> flux-sync-prod  (would clobber existing tag)

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.