release-plz icon indicating copy to clipboard operation
release-plz copied to clipboard

Add a "git only" mode

Open marcoieni opened this issue 1 year ago • 11 comments

Motivations

Some people want to use release-plz without publishing on crates.io. We could use git tags as the source of truth.

Solution

  • [ ] Add a git_only configuration flag at the workspace level, that you can also override for each package. Values: true or false. False by default.
  • [ ] Disable the error introduced in https://github.com/MarcoIeni/release-plz/pull/114 if the git-only mode is on
  • [ ] Make sure to consider packages with publish = false in the Cargo.toml if git-only is on for that package.

Additional context

Created from the discussion in https://github.com/MarcoIeni/release-plz/issues/590#issuecomment-1519170017 and https://github.com/MarcoIeni/release-plz/issues/1139

marcoieni avatar Dec 16 '23 22:12 marcoieni

Thanks for opening this. I am interested in working on it.

jdidion avatar Dec 16 '23 22:12 jdidion

In case it is helpful, on the CLI version, there is a relevant flag --registry-project-manifest flag.

The explanation for that flag is:

Path to the Cargo.toml contained in the released version of the project you want to update. If not provided, the packages of your project will be compared with the ones published in the cargo registry. Normally, this parameter is used only if the published version of your project is already available locally. For example, it could be the path to the project with a `git checkout` on its latest tag. The git history of this project should be behind the one of the project you want to update

ozgunozerk avatar Jan 22 '24 13:01 ozgunozerk

Hey @jdidion do you still work on this? No pressure of course. I'm asking because if you are no longer working on this, maybe someone else wants to pick the issue :)

marcoieni avatar Jan 22 '24 16:01 marcoieni

Hi Marco, yes I've been working on it slowly. Just created a draft PR so you can see the progress https://github.com/MarcoIeni/release-plz/pull/1227. Tl;dr right now I have:

  • implemented the function to fetch the most recent release tag(s) from the git repository
  • created a RepoVersions enum which has variants for a single package or multiple packages (they are different because of the way the git tags are formatted)
  • added a repository_packages: Option<&RepoVersions> parameter to all the functions in next_ver.rs where it is needed

Now I'm looking at how to actually implement get_diff for a git-only package and I'm thinking I need some higher level interface which can abstract whether the package information is coming from the registry or the git repository. Happy to have some input on what you think is the best approach (trait, enum, or something else).

jdidion avatar Jan 22 '24 18:01 jdidion

Thanks @ozgunozerk I'll take a look at that option. Maybe the implementation of that option will hint at how I should implement git-only.

jdidion avatar Jan 22 '24 18:01 jdidion

So far the PR looks great!

I'm thinking I need some higher level interface which can abstract whether the package information is coming from the registry or the git repository

Yes, I think that would help.

Happy to have some input on what you think is the best approach (trait, enum, or something else).

I prefer enum because they are simpler, but whatever it works for you it's fine :)

I would say, let's not overthink it. First let's get it working, and we can refine later :)

marcoieni avatar Jan 25 '24 07:01 marcoieni

Seems like this issue is stale again. I can take over, but what I had in mind overwrites some work @jdidion already did. If he does not have enough time to continue on this, I already have a good understanding of the repo and the issue, and I can take over. What are your thoughts @MarcoIeni?

ozgunozerk avatar May 27 '24 12:05 ozgunozerk

Hey Özgün, great to see you're still interested in working on this. Feel free to take over. If you don't want to overwrite work, you can also start a new PR. As you prefer 👍

marcoieni avatar May 27 '24 16:05 marcoieni

I was eagerly awaiting this feature but seems progress has halted a bit. What is the status on this? I would be happy to help, but going off the PR comments, the issue seems a bit too complex for my limited time and experience with the project. Or is it simpler than it seems?

(I am not making any demands / requests here. I understand it is an open-source project, and I truly admire the effort that went into the project.)

Mouwrice avatar Jul 27 '24 12:07 Mouwrice

Or is it simpler than it seems?

It's not 😅

The most recent work on this is in https://github.com/MarcoIeni/release-plz/pull/1497. Not sure if @ozgunozerk wants to keep working on it or if he is just taking a break from this effort 👍

marcoieni avatar Jul 27 '24 13:07 marcoieni

Hi everyone!

My workload got heavier and this feature unfortunately got lost in my backlog. I'm not sure when I can get back to that so don't want to promise anything.

If anybody is willing to take this over, please go ahead :)

ozgunozerk avatar Jul 27 '24 14:07 ozgunozerk