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

Make dist plan handle mismatched project versions #1554

Open
duckinator opened this issue Nov 13, 2024 · 3 comments
Open

Make dist plan handle mismatched project versions #1554

duckinator opened this issue Nov 13, 2024 · 3 comments

Comments

@duckinator
Copy link
Contributor

If there's packages with two different versions (let's say foo + bar 1.0.0 and baz 2.0.0), currently dist plan fails like this:

  × There are too many unrelated apps in your workspace to coherently Announce!
  help: Please either specify --tag, or give them all the same version
        
        Here are some options:
        
        --tag=v1.0.0 will Announce: foo, bar
        --tag=v2.0.0 will Announce: baz
        
        you can also request any single package with --tag=foo-v1.0.0

It would be useful to have it figure out what potential tags there are, and then generate the usual dist plan output for each one.

Possibly something closer to this:

  × There are too many unrelated apps in your workspace to coherently Announce!
  help: Please either specify --tag, or give them all the same version
        
        Here are some options:
        
        --tag=v1.0.0 will Announce: foo, bar
        --tag=v2.0.0 will Announce: baz
        
        you can also request any single package with --tag=foo-v1.0.0

--tag=v1.0.0 would announce
  foo 1.0.0
    [...]
  bar 1.0.0
    [...]

--tag=v2.0.0 would announce
  baz 2.0.0
    [...]
@duckinator
Copy link
Contributor Author

I'm not entirely sure that we want to keep the exact "There are too many ..."/"help: ..." text we have now, but I'm also not sure what to replace it with. I think the information it's conveying is useful, but may be a bit confusing when combined with information on what --tag=... options can be used.

There is also the open question of how to handle the JSON output.

@kekonn
Copy link

kekonn commented Nov 21, 2024

I am running into a similar issue, where dist plan is being run as a PR check (I believe this is how cargo dist sets itself up?) and because a PR does not have a specific tag, I couldn't even apply one if I wanted to.

So in short. Doing this check when running as part of a PR check, seems like a bug to me.

@duckinator
Copy link
Contributor Author

duckinator commented Nov 22, 2024

I just went through all the notes I have and what @alilleybrinker has mentioned, and I boiled it all down to 3 chunks:

  1. Set needs_coherence = false in cmd_plan(). (See @alilleybrinker's work.)
  2. if pr-run-mode = "upload": Have dist build run for every discovered tag.
  3. if there's more than one tag, have dist plan show more information, e.g. Improve interactive dist plan output #1560.

The first one being the most important, since it is actively causing problems for multiple users.

With just the first one resolved, mismatched tags/versions + the default pr-run-mode = "plan" will work, but mismatched tags/versions + pr-run-mode = "upload" will NOT work.

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

2 participants