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

CI cannot create a release-pr #1668

Closed
NobodyXu opened this issue Apr 23, 2024 · 8 comments · Fixed by cargo-bins/release-pr#114
Closed

CI cannot create a release-pr #1668

NobodyXu opened this issue Apr 23, 2024 · 8 comments · Fixed by cargo-bins/release-pr#114

Comments

@NobodyXu
Copy link
Member

https://github.com/cargo-bins/cargo-binstall/actions/runs/8800532740

it says cannot find the crate atomic-file-install due to a parsing error

Probably cargo updates something the CI assumes and breaks it.

2024-04-23T12:39:18.0949623Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/atomic-file-install#1.0.2", skipping
2024-04-23T12:39:18.0959072Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/bin#[email protected]", skipping
2024-04-23T12:39:18.0961880Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk#0.22.0", skipping
2024-04-23T12:39:18.0964532Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-bins#0.4.0", skipping
2024-04-23T12:39:18.0967259Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-types#0.7.0", skipping
2024-04-23T12:39:18.0970410Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/normalize-path#0.2.1", skipping
2024-04-23T12:39:18.0973173Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-downloader#0.10.1", skipping
2024-04-23T12:39:18.0976237Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-fetchers#0.4.0", skipping
2024-04-23T12:39:18.0979082Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-registry#0.7.0", skipping
2024-04-23T12:39:18.0981945Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/cargo-toml-workspace#5.0.0", skipping
2024-04-23T12:39:18.0984693Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/detect-targets#0.1.15", skipping
2024-04-23T12:39:18.0987417Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/binstalk-manifests#0.13.0", skipping
2024-04-23T12:39:18.0990020Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/fs-lock#0.1.3", skipping
2024-04-23T12:39:18.0992695Z ##[warning]could not parse package format: "path+file:///home/runner/work/cargo-binstall/cargo-binstall/crates/detect-wasi#1.0.0", skipping
2024-04-23T12:39:18.0995682Z ##[error]no matching crate found

cc @passcod Maybe we should switch to release-plz

@NobodyXu NobodyXu mentioned this issue Apr 23, 2024
6 tasks
@NobodyXu
Copy link
Member Author

Now there's a problem:

release-plz has the capability to release and publish the crates, however it doesn't seem to be capability of

  • generating a ephemeral minisign key pair
  • building artifacts
  • put minisign public key and artifacts onto release pages
  • delete the minisign private key

Also, release-plz would publish cargo-binstall-v* which is a bit different from our convention, I read the configuration and I don't think it supports this for now.

I thought of only using release-plz to create release-pr and then run release-plz release --dry-run -o json to get the crates to release, and then continue doing it manually, however I'm not sure how to generate release-note then.

cc @passcod I need some help on this.

@passcod
Copy link
Member

passcod commented Apr 30, 2024

Maybe we should fix release-pr instead, as nice as release-plz initially looks, it's useless if it doesn't support what we need

@NobodyXu
Copy link
Member Author

NobodyXu commented May 1, 2024

It seems to me that release-pr has problem parsing cargo metadata --format-version=1 output, to be specific, the workspace_memebrs:

[
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/atomic-file-install#1.0.2",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/bin#[email protected]",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk#0.22.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-bins#0.4.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-types#0.7.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/normalize-path#0.2.1",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-downloader#0.10.1",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-fetchers#0.4.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-registry#0.7.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/cargo-toml-workspace#5.0.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/detect-targets#0.1.15",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-manifests#0.13.0",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/fs-lock#0.1.3",
  "path+file:///Users/nobodyxu/Dev/cargo-binstall/crates/detect-wasi#1.0.0"
]

release-pr expects type WorkspaceMemberString = ${string} ${string} (${string});, however the format it gets is totally different

@NobodyXu
Copy link
Member Author

NobodyXu commented May 1, 2024

I've found cargo-workspaces which can list all workspaces using cargo workspaces list --json:

[
  {
    "name": "atomic-file-install",
    "version": "1.0.2",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/atomic-file-install",
    "private": false
  },
  {
    "name": "cargo-binstall",
    "version": "1.6.4",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/bin",
    "private": false
  },
  {
    "name": "binstalk",
    "version": "0.22.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk",
    "private": false
  },
  {
    "name": "binstalk-bins",
    "version": "0.4.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-bins",
    "private": false
  },
  {
    "name": "binstalk-downloader",
    "version": "0.10.1",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-downloader",
    "private": false
  },
  {
    "name": "binstalk-fetchers",
    "version": "0.4.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-fetchers",
    "private": false
  },
  {
    "name": "binstalk-manifests",
    "version": "0.13.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-manifests",
    "private": false
  },
  {
    "name": "binstalk-registry",
    "version": "0.7.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-registry",
    "private": false
  },
  {
    "name": "binstalk-types",
    "version": "0.7.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/binstalk-types",
    "private": false
  },
  {
    "name": "cargo-toml-workspace",
    "version": "5.0.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/cargo-toml-workspace",
    "private": false
  },
  {
    "name": "detect-targets",
    "version": "0.1.15",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/detect-targets",
    "private": false
  },
  {
    "name": "detect-wasi",
    "version": "1.0.0",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/detect-wasi",
    "private": false
  },
  {
    "name": "fs-lock",
    "version": "0.1.3",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/fs-lock",
    "private": false
  },
  {
    "name": "normalize-path",
    "version": "0.2.1",
    "location": "/Users/nobodyxu/Dev/cargo-binstall/crates/normalize-path",
    "private": false
  }
]

seems to be good enough for our use case.

Skim through its source code, seems fine.

Edit:

It alsoi works with crates without Cargo.lock

@NobodyXu
Copy link
Member Author

NobodyXu commented May 1, 2024

cc @passcod I've opened cargo-bins/release-pr#114 for this.

BTW it would be great if we could release multiple crates like release-pr does, having to manually open PR for each crate to release in order is annoying.

@passcod
Copy link
Member

passcod commented May 1, 2024

I think the main issue with multiple release is how to specify the version bumps correctly without requiring even more work if wanting to change whatever the tool auto picked. Something more interactive like dependabot's UX perhaps, but that's a bunch more work.

@NobodyXu
Copy link
Member Author

NobodyXu commented May 2, 2024

That's true, so for now I will just bear with it, hopefully we could eventually upgrade to release-plz or simply updates our own release-pr

@passcod
Copy link
Member

passcod commented May 2, 2024

Yeah, I've been successfully experimenting with lightweight github-actions-based UIs at work for that kind of thing, so I'll have a think at how to make this go in release-pr.

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

Successfully merging a pull request may close this issue.

2 participants