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

Closed
duckinator opened this issue Nov 13, 2024 · 4 comments · Fixed by #1595
Closed

Make dist plan handle mismatched project versions #1554

duckinator opened this issue Nov 13, 2024 · 4 comments · Fixed by #1595

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 and a stopgap measure for usability:

  1. Set needs_coherence = false in cmd_plan(). (feat: Permit tag incoherence for dist plan #1579)
  2. (stopgap) Have dist plan fail on incoherent tasks, since workflows will fail later in dist build anyway. (If pr-run-mode="upload", fail in the "plan" job instead of the "build-local-artifacts" job. #1587)
  3. if pr-run-mode = "upload": Undo the stopgap and have dist build run for every discovered tag.
  4. if there's more than one tag, have dist plan show more information, e.g. Improve interactive dist plan output if there's multiple versions in a workspace #1595.

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.

@duckinator
Copy link
Contributor Author

I split the bit about pr-run-mode="upload" off to #1596.

#1595 handles improving the "human" output of dist plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants