Skip to content

Check umbrella version#8250

Merged
iulianbarbu merged 13 commits intoparitytech:masterfrom
Wolfenheimm:wolfenheimm/check-umbrella-version
Apr 25, 2025
Merged

Check umbrella version#8250
iulianbarbu merged 13 commits intoparitytech:masterfrom
Wolfenheimm:wolfenheimm/check-umbrella-version

Conversation

@Wolfenheimm
Copy link
Copy Markdown
Contributor

@Wolfenheimm Wolfenheimm commented Apr 15, 2025

Description

This PR fixes the issue where check-umbrella fails unless the proper umbrella crate version is hardcoded into the workflow. The solution adds the version detection logic to properly determine the umbrella crate version by:

  1. Using cargo metadata & jq to extract the version, specifying umbrella/cargo.toml
  2. Falling back to using version 0.1.0 if metadata fails

Fixes #8029

Integration

No integration changes are required for downstream projects.
The workflow will now always use the version from cargo metadata if available, or fallback to 0.1.0 if not.
No environment variables or external configuration changes are needed.

Review Notes

  • Modified version extraction logic in check-umbrella job to dynamically determine the correct version

Checklist

  • My PR includes a detailed description as outlined in the "Description" and its two subsections above.
  • My PR follows the labeling requirements of this project (at minimum one label for T required)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Copy link
Copy Markdown
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a crack at this! I like the cargo metadata based approach, and IMO we can simplify the changes. LMK what you think. For testing these changes against a stable branch, you can open another draft PR against stable2503/stable2412, and ping me to allow the CI to run. :)

@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

Thanks for taking a crack at this! I like the cargo metadata based approach, and IMO we can simplify the changes. LMK what you think. For testing these changes against a stable branch, you can open another draft PR against stable2503/stable2412, and ping me to allow the CI to run. :)

LGTM, let me whip up those fixes as soon as I can, should be ready in a few hours.

…etadata calal and fallback to 0.1.0 if anything
@iulianbarbu
Copy link
Copy Markdown
Contributor

Hey @Wolfenheimm ! Sorry for my lack of clarity. The PR as opened here is what we want. The suggestion to open another draft against stable2503 was just related to testing that the workflow works there as well. It is good that you opened one more draft there, but once we're clear that the job works as expected, we can close that one (I'll do it myself).

The process we currently use is that we do PRs against master first and once merged we backport to the relevant stable releases branches. We have an automation where we can label the merged PRs and they'll be automatically picked by a bot and a new PR opened against the relevant stable release branch. You don't have to worry about merging these changes into the stable release branches for now (it will be my job after we merge this PR), but we can still check if the job works correctly there in a dedicated PR in parallel.

@iulianbarbu iulianbarbu reopened this Apr 16, 2025
@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

Hey @Wolfenheimm ! Sorry for my lack of clarity. The PR as opened here is what we want. The suggestion to open another draft against stable2503 was just related to testing that the workflow works there as well. It is good that you opened one more draft there, but once we're clear that the job works as expected, we can close that one (I'll do it myself).

The process we currently use is that we do PRs against master first and once merged we backport to the relevant stable releases branches. We have an automation where we can label the merged PRs and they'll be automatically picked by a bot and a new PR opened against the relevant stable release branch. You don't have to worry about merging these changes into the stable release branches for now (it will be my job after we merge this PR), but we can still check if the job works correctly there in a dedicated PR in parallel.

Haha whoops on my part as well. Here to help, no worries!

@Wolfenheimm Wolfenheimm force-pushed the wolfenheimm/check-umbrella-version branch from f808af5 to 36f2e75 Compare April 16, 2025 20:12
@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

Wolfenheimm commented Apr 16, 2025

@iulianbarbu - New PR on #8268 - I thought Master -> stable would play nice but I had to make a new branch based on stable2503 and cherry pick my commits to it 😢

@Wolfenheimm Wolfenheimm changed the title Wolfenheimm/check umbrella version Check umbrella version Apr 16, 2025
@iulianbarbu iulianbarbu added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Apr 18, 2025
@iulianbarbu iulianbarbu marked this pull request as ready for review April 18, 2025 09:26
Copy link
Copy Markdown
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Will be good to update the PR description as well before merging.

@github-actions github-actions bot requested a review from iulianbarbu April 18, 2025 19:11
@github-actions
Copy link
Copy Markdown
Contributor

Review required! Latest push from author must always be reviewed

@iulianbarbu iulianbarbu added this pull request to the merge queue Apr 24, 2025
@ggwpez
Copy link
Copy Markdown
Member

ggwpez commented Apr 24, 2025

It would also be possibly to modify the generate-umbrella.py script and read the version from the Cargo.toml?!

@iulianbarbu iulianbarbu removed this pull request from the merge queue due to a manual request Apr 24, 2025
@iulianbarbu
Copy link
Copy Markdown
Contributor

It would also be possibly to modify the generate-umbrella.py script and read the version from the Cargo.toml?!

Actually yes! Thinking outside of the box 👀 . It should be less changes. I would support changing to that if @Wolfenheimm is up for it, but either way, I would be happy to merge this as is and maybe do the python equivalent whenever we feel like. TBH it is something I would rather throw in there in any reasonable form and just forget about, but I agree it is not the best solution.

@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

It would also be possibly to modify the generate-umbrella.py script and read the version from the Cargo.toml?!

Actually yes! Thinking outside of the box 👀 . It should be less changes. I would support changing to that if @Wolfenheimm is up for it, but either way, I would be happy to merge this as is and maybe do the python equivalent whenever we feel like. TBH it is something I would rather throw in there in any reasonable form and just forget about, but I agree it is not the best solution.

The umbrella script is originally meant to take in a version flag, right now we hard-code in the version for every version we create. By that same logic, why weren't we hard coding the version inside each script?

Also, fetching jq does not even need to be done, the mechanism is there in-case it isn't (in-case we are scared of bloat):
image

I'm willing to do the change inside the python file, let me know 👍

@iulianbarbu
Copy link
Copy Markdown
Contributor

By that same logic, why weren't we hard coding the version inside each script?

Yeh, I think @ggwpez suggests a different code path where instead of generating the umbrella crate's Cargo.toml by giving it a version, we rely on the fact the crate already exists and pick its version from the Cargo.toml. Same same but different 😅 . You can argue it helps whenever we want to run the script locally while not being concerned with the version (since otherwise we'd either need to run the bash commands you do, or look into the umbrella/Cargo.toml to check the version, and use it). We might run this locally whenever we do changes which should be propagated to polkadot-sdk, and need to commit them.

The new aspect would be a new requirement, but I don't find it necessary. I think we would solve a non-problem though, since for most of times we run the script on master where polkadot-sdk version is set to 0.1.0. Another argument is that it might be a better practice to keep the scripting to a single language and not mix them, but I am fine keeping a certain API for the python script, and feed into it anything is needed through bash.

@ggwpez , do you see other benefits of implementing this in the python script? IMO it doesn't matter that much, and we should be good to merge - unless you request changes for some reason.

Otherwise, sorry for my overindexing in advance. Just trying to make sure we don't miss anything.

@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

By that same logic, why weren't we hard coding the version inside each script?

Yeh, I think @ggwpez suggests a different code path where instead of generating the umbrella crate's Cargo.toml by giving it a version, we rely on the fact the crate already exists and pick its version from the Cargo.toml. Same same but different 😅 . You can argue it helps whenever we want to run the script locally while not being concerned with the version (since otherwise we'd either need to run the bash commands you do, or look into the umbrella/Cargo.toml to check the version, and use it). We might run this locally whenever we do changes which should be propagated to polkadot-sdk, and need to commit them.

The new aspect would be a new requirement, but I don't find it necessary. I think we would solve a non-problem though, since for most of times we run the script on master where polkadot-sdk version is set to 0.1.0. Another argument is that it might be a better practice to keep the scripting to a single language and not mix them, but I am fine keeping a certain API for the python script, and feed into it anything is needed through bash.

@ggwpez , do you see other benefits of implementing this in the python script? IMO it doesn't matter that much, and we should be good to merge - unless you request changes for some reason.

Otherwise, sorry for my overindexing in advance. Just trying to make sure we don't miss anything.

@Wolfenheimm Wolfenheimm reopened this Apr 24, 2025
@Wolfenheimm
Copy link
Copy Markdown
Contributor Author

Sorry for closing this, hard accident, dropped my phone and button mashed 😓

@ggwpez
Copy link
Copy Markdown
Member

ggwpez commented Apr 25, 2025

do you see other benefits of implementing this in the python script? IMO it doesn't matter that much, and we should be good to merge - unless you request changes for some reason.

Yea I dont really care if it works, just wanted to point it out.

@iulianbarbu iulianbarbu added this pull request to the merge queue Apr 25, 2025
Merged via the queue into paritytech:master with commit c854f7c Apr 25, 2025
234 of 241 checks passed
@iulianbarbu iulianbarbu added A4-backport-stable2503 Pull request must be backported to the stable2503 release branch A4-backport-stable2412 labels Apr 25, 2025
@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for stable2412:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-8250-to-stable2412
git worktree add --checkout .worktree/backport-8250-to-stable2412 backport-8250-to-stable2412
cd .worktree/backport-8250-to-stable2412
git reset --hard HEAD^
git cherry-pick -x c854f7c6b7291154072d8e931eddb426f98217fc
git push --force-with-lease

@paritytech-release-backport-bot
Copy link
Copy Markdown

Git push to origin failed for stable2412 with exitcode 1

@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for stable2503:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-8250-to-stable2503
git worktree add --checkout .worktree/backport-8250-to-stable2503 backport-8250-to-stable2503
cd .worktree/backport-8250-to-stable2503
git reset --hard HEAD^
git cherry-pick -x c854f7c6b7291154072d8e931eddb426f98217fc
git push --force-with-lease

@paritytech-release-backport-bot
Copy link
Copy Markdown

Git push to origin failed for stable2503 with exitcode 1

wassimans pushed a commit to wassimans/polkadot-sdk that referenced this pull request Apr 27, 2025
# Description

This PR fixes the issue where check-umbrella fails unless the proper
umbrella crate version is hardcoded into the workflow. The solution adds
the version detection logic to properly determine the umbrella crate
version by:

1. Using cargo metadata & jq to extract the version, specifying
umbrella/cargo.toml
2. Falling back to using version 0.1.0 if metadata fails

Fixes paritytech#8029

## Integration

No integration changes are required for downstream projects.  
The workflow will now always use the version from `cargo metadata` if
available, or fallback to `0.1.0` if not.
No environment variables or external configuration changes are needed.

## Review Notes

- Modified version extraction logic in `check-umbrella` job to
dynamically determine the correct version

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [x] My PR follows the labeling requirements of this project (at
minimum one label for `T` required)
* [ ] I have made corresponding changes to the documentation (if
applicable)
* [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
ordian added a commit that referenced this pull request Apr 28, 2025
* master: (120 commits)
  [CI] Improve GH build status checking (#8331)
  [CI/CD] Use original PR name in prdoc check for the backport PR's to the stable branches (#8329)
  Add new host APIs set_storage_or_clear and get_storage_or_zero (#7857)
  push to dockerhub (#8322)
  Snowbridge - V1 - Adds 2 hop transfer to Rococo (#7956)
  [AHM] Prepare `election-provider-multi-block` for full lazy data deletion (#8304)
  Check umbrella version (#8250)
  [AHM] Fully bound staking async (#8303)
  migrate parachain-templates tests to `gha` (#8226)
  staking-async: add missing new_session_genesis (#8310)
  New NFT traits: granular and abstract interface (#5620)
  Extract create_pool_with_native_on macro to common crate (#8289)
  XCMP: use batching when enqueuing inbound messages (#8021)
  Snowbridge - Tests refactor (#8014)
  Allow configuration of worst case buy execution weight (#7944)
  Fix faulty pre-upgrade migration check in pallet-session (#8294)
  [pallet-revive] add get_storage_var_key for variable-sized keys (#8274)
  add poke_deposit extrinsic to pallet-recovery (#7882)
  `txpool`: use tracing for structured logging (#8001)
  [revive] eth-rpc refactoring (#8148)
  ...
EgorPopelyaev pushed a commit that referenced this pull request Apr 29, 2025
Backport #8250 into `stable2412` from Wolfenheimm.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Jesse Rafters <jesse.rafters@gmail.com>
Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
EgorPopelyaev added a commit that referenced this pull request Apr 30, 2025
Backport #8250 into `stable2503` from Wolfenheimm.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Jesse Rafters <jesse.rafters@gmail.com>
Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
Co-authored-by: Egor_P <egor@parity.io>
castillax pushed a commit that referenced this pull request May 12, 2025
# Description

This PR fixes the issue where check-umbrella fails unless the proper
umbrella crate version is hardcoded into the workflow. The solution adds
the version detection logic to properly determine the umbrella crate
version by:

1. Using cargo metadata & jq to extract the version, specifying
umbrella/cargo.toml
2. Falling back to using version 0.1.0 if metadata fails

Fixes #8029

## Integration

No integration changes are required for downstream projects.  
The workflow will now always use the version from `cargo metadata` if
available, or fallback to `0.1.0` if not.
No environment variables or external configuration changes are needed.

## Review Notes

- Modified version extraction logic in `check-umbrella` job to
dynamically determine the correct version

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [x] My PR follows the labeling requirements of this project (at
minimum one label for `T` required)
* [ ] I have made corresponding changes to the documentation (if
applicable)
* [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2503 Pull request must be backported to the stable2503 release branch R0-no-crate-publish-required The change does not require any crates to be re-published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check-umbrella fails on stable branches due to sdk version used

6 participants