Git Product home page Git Product logo

Comments (8)

webpro avatar webpro commented on May 23, 2024

Does it all happen in the same branch? I see requireBranch: release-job.

Also see https://github.com/release-it/release-it/blob/main/docs/git.md#use-all-refs-to-determine-latest-tag

from release-it.

hickey avatar hickey commented on May 23, 2024

While I was developing the workflow I had removed the requireBranch setting. Now that I am getting closer to the point I can go a release I have added requireBranch back in to simulate what it will be like when I can update the setting for requiring the release branch.

The job runs that I referenced above in the description are running on the release-job branch. I just checked the checkout action of the failed job and see:

Checking out the ref
  /usr/bin/git checkout --progress --force -B release-job refs/remotes/origin/release-job
  Switched to a new branch 'release-job'
  branch 'release-job' set up to track 'origin/release-job'.

So to me that does indicate that the job is happening on the release-job branch.

Interesting..... I was just looking at the output above to say "yes, even the log shows it on the release-job branch", but I found something I did not expect.

Run git log --graph --all --pretty=format:'%h - (%cr) %s%d' --abbrev-commit --date=relative
* 7fecbef - (43 seconds ago) chore(release): 3.0.0 (tag: v3.0.0)
* e98269c - (81 seconds ago) fixup (HEAD -> release-job, origin/release-job)
* d63b3be - (3 minutes ago) fixup
* d73ee89 - (5 minutes ago) fixup

While HEAD is on release-job, the actual v3.0.0 is on the commit ahead of the branch. At the end of the create-release job I also printed out the git log to verify that the commits occurred. On that output it shows the tag and the branch on the same commit. Does release-it not push the branch back to the repo? It appears that it does indirectly by pushing the tag, but without pushing the branch the HEAD of the branch does not get updated. Is this expected or am I not understanding something?

from release-it.

webpro avatar webpro commented on May 23, 2024

The default behavior is a git push --follow-tags, as is the logs show. The exact commands are logged.

If extra arguments are required they can be added (see the same docs page).

from release-it.

hickey avatar hickey commented on May 23, 2024

OK, I am still reviewing the git page document you sent.

I agree that given your last comment and what I am seeing in the job output that it does appear that release-it is pushing the branch back to the repo. Especially since I see that origin/release-job has been updated to the latest HEAD and the tag commit.

I am still trying to understand all the actions that release-it is taking and that I am not mis-understanding the process that release-it is expecting to follow. Through this discussion I am starting to think that release-it is doing the right things. You are not seeing anything that I am doing (either command or config file) that is an issue and believe that release-it is operating as expected?

I am assuming that you are going to respond with "every thing is working as expected" to the above question. Which tells me and given where I am finding HEAD pointing in the 3rd job, that there is a caching issue when the repo is checked out for the 3rd job. Is that your impression also?

Thanks.

from release-it.

webpro avatar webpro commented on May 23, 2024

The thing is, there isn't that much more I can say, since you can exactly see what release-it does. Hopefully it provides enough flexibility to make it do whatever you want.

For instance, a git push may or may not push to the correct remote url. I can't know/see that.

This reminds me: you can also use --debug which reveals more verbose output such as the output of the commands.

from release-it.

webpro avatar webpro commented on May 23, 2024

Scratch that, mixing up tooling here. I meant prefix the command with NODE_DEBUG=release-it:*.

from release-it.

hickey avatar hickey commented on May 23, 2024

OK. I will give that a try and see if I find more info to confirm my suspicions.

My release process is quite simple (at least I think so). I will cut a PR to the release branch with the changes to go into the release. Approval/merging of the PR will kick off the workflow which will create the release (working), create the packaging as artifacts (working, but outside the scope of release-it), and then attach the artifacts to the release.

I have been able to get all of this working by manually executing release-it and trying to be as close as I can be to the CI environment. So this fact and this discussion is convincing me that release-it is correct and working as I expected.

Thank you for your help today.

from release-it.

hickey avatar hickey commented on May 23, 2024

In case anyone else finds this issue and has problems like the one described, I found that I needed to execute a git pull immediately after the actions/checkout step. Once this was done the HEAD of the branch was on the proper commit.

from release-it.

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.