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

release-libs.yaml automatically triggered on PRs to main #790

Merged

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Mar 12, 2024

Every time we merge some PR from dev to main, we need to make sure every modified crate version is properly increased. Otherwise, we will mess up the dependency chain of whoever is fetching from crates.io

This PR:

  • changes release-libs.yaml so that the Release Libs workflow is triggered every time a PR is created against main.
  • introduces a shell script (check-versioning-lib-release.sh) that checks the diff between main and dev branches... if some lib crate has been changed but its version wasn't bumped, the CI will trigger an error and stop (here's an example on my fork)
  • removes roles from being published to crates.io (it doesn't make sense until high-level SRI APIs for external consumption #702 is completed, which will take a long time)

@plebhash plebhash force-pushed the trigger-release-lib-automatically branch from b634bb5 to 4c6ac21 Compare March 12, 2024 18:08
@plebhash plebhash marked this pull request as draft March 12, 2024 18:08
@plebhash plebhash changed the title release-libs on push to main release-libs.yaml automatically triggered on push to main Mar 12, 2024
Copy link
Contributor

github-actions bot commented Mar 12, 2024

🐰Bencher

ReportWed, April 3, 2024 at 15:42:02 UTC
ProjectStratum v2 (SRI)
Branchtrigger-release-lib-automatically
Testbedsv2
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
client_sv2_handle_message_common✅ (view plot)2073.000 (+0.37%)2153.009 (96.28%)✅ (view plot)473.000 (+0.28%)494.536 (95.65%)✅ (view plot)733.000 (+0.16%)763.992 (95.94%)✅ (view plot)9.000 (+4.65%)14.376 (62.60%)✅ (view plot)37.000 (+0.34%)38.665 (95.69%)
client_sv2_handle_message_mining✅ (view plot)8249.000 (+0.68%)8347.958 (98.81%)✅ (view plot)2137.000 (+0.62%)2173.570 (98.32%)✅ (view plot)3159.000 (+0.68%)3216.572 (98.21%)✅ (view plot)38.000 (-6.11%)44.562 (85.28%)✅ (view plot)140.000 (+0.96%)142.014 (98.58%)
client_sv2_mining_message_submit_standard✅ (view plot)6296.000 (-0.06%)6408.914 (98.24%)✅ (view plot)1750.000 (-0.07%)1771.416 (98.79%)✅ (view plot)2551.000 (-0.08%)2584.097 (98.72%)✅ (view plot)21.000 (+3.45%)26.200 (80.15%)✅ (view plot)104.000 (-0.14%)107.213 (97.00%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14837.000 (+0.53%)15039.686 (98.65%)✅ (view plot)4694.000 (-0.02%)4715.416 (99.55%)✅ (view plot)6752.000 (-0.05%)6785.162 (99.51%)✅ (view plot)49.000 (-0.36%)54.133 (90.52%)✅ (view plot)224.000 (+1.07%)229.499 (97.60%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27602.000 (+0.54%)27873.839 (99.02%)✅ (view plot)10545.000 (+0.03%)10566.504 (99.80%)✅ (view plot)15337.000 (-0.01%)15369.429 (99.79%)✅ (view plot)87.000 (+1.34%)90.868 (95.74%)✅ (view plot)338.000 (+1.23%)345.370 (97.87%)
client_sv2_open_channel✅ (view plot)4531.000 (+0.80%)4618.750 (98.10%)✅ (view plot)1461.000 (-0.05%)1482.681 (98.54%)✅ (view plot)2151.000 (-0.16%)2184.337 (98.47%)✅ (view plot)14.000 (+12.90%)16.165 (86.61%)✅ (view plot)66.000 (+1.38%)68.135 (96.87%)
client_sv2_open_channel_serialize✅ (view plot)14330.000 (+0.76%)14496.162 (98.85%)✅ (view plot)5064.000 (-0.01%)5085.681 (99.57%)✅ (view plot)7315.000 (-0.05%)7349.042 (99.54%)✅ (view plot)38.000 (-1.62%)42.296 (89.84%)✅ (view plot)195.000 (+1.72%)199.364 (97.81%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22814.000 (+0.76%)23076.200 (98.86%)✅ (view plot)7987.000 (+0.04%)8008.976 (99.73%)✅ (view plot)11609.000 (-0.03%)11643.085 (99.71%)✅ (view plot)78.000 (+3.97%)83.039 (93.93%)✅ (view plot)309.000 (+1.51%)315.751 (97.86%)
client_sv2_setup_connection✅ (view plot)4703.000 (-0.22%)4778.742 (98.42%)✅ (view plot)1502.000 (-0.05%)1523.681 (98.58%)✅ (view plot)2278.000 (+0.02%)2310.807 (98.58%)✅ (view plot)9.000 (-12.83%)14.792 (60.84%)✅ (view plot)68.000 (-0.18%)69.714 (97.54%)
client_sv2_setup_connection_serialize✅ (view plot)16338.000 (+0.48%)16478.853 (99.15%)✅ (view plot)5963.000 (-0.01%)5984.681 (99.64%)✅ (view plot)8653.000 (-0.04%)8687.619 (99.60%)✅ (view plot)46.000 (-0.05%)51.175 (89.89%)✅ (view plot)213.000 (+1.12%)216.595 (98.34%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35620.000 (+0.22%)35783.879 (99.54%)✅ (view plot)14814.000 (+0.02%)14835.976 (99.85%)✅ (view plot)21745.000 (-0.02%)21780.162 (99.84%)✅ (view plot)108.000 (+7.52%)117.815 (91.67%)✅ (view plot)381.000 (+0.34%)384.503 (99.09%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented Mar 12, 2024

🐰Bencher

ReportWed, April 3, 2024 at 15:42:06 UTC
ProjectStratum v2 (SRI)
Branchtrigger-release-lib-automatically
Testbedsv1
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
get_authorize✅ (view plot)8444.000 (-0.19%)8513.331 (99.19%)✅ (view plot)3746.000 (-0.18%)3777.847 (99.16%)✅ (view plot)5249.000 (-0.21%)5298.721 (99.06%)✅ (view plot)9.000 (+10.09%)10.815 (83.21%)✅ (view plot)90.000 (-0.28%)91.484 (98.38%)
get_submit✅ (view plot)95545.000 (-0.01%)95624.556 (99.92%)✅ (view plot)59439.000 (-0.02%)59505.681 (99.89%)✅ (view plot)85350.000 (-0.03%)85465.594 (99.86%)✅ (view plot)58.000 (+4.18%)61.521 (94.28%)✅ (view plot)283.000 (0.00%)284.840 (99.35%)
get_subscribe✅ (view plot)8011.000 (-0.01%)8084.986 (99.08%)✅ (view plot)2841.000 (-0.17%)2866.986 (99.09%)✅ (view plot)3966.000 (-0.23%)4004.082 (99.05%)✅ (view plot)18.000 (+11.08%)20.240 (88.93%)✅ (view plot)113.000 (-0.02%)114.704 (98.51%)
serialize_authorize✅ (view plot)12197.000 (-0.17%)12319.941 (99.00%)✅ (view plot)5317.000 (-0.13%)5348.847 (99.40%)✅ (view plot)7412.000 (-0.15%)7460.586 (99.35%)✅ (view plot)12.000 (+6.90%)13.478 (89.03%)✅ (view plot)135.000 (-0.30%)137.718 (98.03%)
serialize_deserialize_authorize✅ (view plot)24438.000 (-0.16%)24557.774 (99.51%)✅ (view plot)9898.000 (-0.09%)9944.180 (99.54%)✅ (view plot)13958.000 (-0.11%)14035.958 (99.44%)✅ (view plot)38.000 (+2.01%)40.635 (93.52%)✅ (view plot)294.000 (-0.26%)296.704 (99.09%)
serialize_deserialize_handle_authorize✅ (view plot)30161.000 (-0.00%)30233.845 (99.76%)✅ (view plot)12101.000 (-0.06%)12132.847 (99.74%)✅ (view plot)17121.000 (-0.07%)17173.112 (99.70%)✅ (view plot)60.000 (+1.14%)63.477 (94.52%)✅ (view plot)364.000 (+0.06%)366.126 (99.42%)
serialize_deserialize_handle_submit✅ (view plot)126400.000 (-0.01%)126478.024 (99.94%)✅ (view plot)73224.000 (-0.01%)73285.206 (99.92%)✅ (view plot)104940.000 (-0.02%)105052.700 (99.89%)✅ (view plot)127.000 (+4.74%)134.023 (94.76%)✅ (view plot)595.000 (-0.08%)598.453 (99.42%)
serialize_deserialize_handle_subscribe✅ (view plot)27481.000 (+0.00%)27557.067 (99.72%)✅ (view plot)9643.000 (-0.05%)9668.986 (99.73%)✅ (view plot)13636.000 (-0.06%)13674.327 (99.72%)✅ (view plot)67.000 (+1.32%)71.629 (93.54%)✅ (view plot)386.000 (+0.03%)388.212 (99.43%)
serialize_deserialize_submit✅ (view plot)114985.000 (-0.04%)115182.648 (99.83%)✅ (view plot)68001.000 (-0.02%)68123.412 (99.82%)✅ (view plot)97555.000 (-0.03%)97765.554 (99.78%)✅ (view plot)70.000 (+2.19%)73.007 (95.88%)✅ (view plot)488.000 (-0.13%)490.679 (99.45%)
serialize_deserialize_subscribe✅ (view plot)22870.000 (-0.11%)22941.388 (99.69%)✅ (view plot)8195.000 (-0.07%)8222.459 (99.67%)✅ (view plot)11540.000 (-0.08%)11581.552 (99.64%)✅ (view plot)40.000 (+1.59%)43.721 (91.49%)✅ (view plot)318.000 (-0.17%)319.971 (99.38%)
serialize_submit✅ (view plot)99862.000 (-0.02%)100000.235 (99.86%)✅ (view plot)61483.000 (-0.02%)61549.681 (99.89%)✅ (view plot)88197.000 (-0.02%)88309.714 (99.87%)✅ (view plot)58.000 (+2.97%)60.842 (95.33%)✅ (view plot)325.000 (-0.05%)326.833 (99.44%)
serialize_subscribe✅ (view plot)11340.000 (-0.07%)11449.952 (99.04%)✅ (view plot)4188.000 (-0.12%)4213.986 (99.38%)✅ (view plot)5825.000 (-0.15%)5862.499 (99.36%)✅ (view plot)18.000 (+8.11%)19.785 (90.98%)✅ (view plot)155.000 (-0.11%)157.815 (98.22%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented Mar 12, 2024

🐰Bencher

ReportWed, April 3, 2024 at 15:42:08 UTC
ProjectStratum v2 (SRI)
Branch790/merge
Testbedsv1
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)7145.400 (+2.27%)7354.109 (97.16%)
client-submit-serialize-deserialize✅ (view plot)8206.100 (+3.63%)8343.569 (98.35%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8598.200 (+1.66%)8818.284 (97.50%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)909.100 (+0.98%)934.188 (97.31%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)685.050 (-1.67%)720.699 (95.05%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)248.150 (+0.10%)253.470 (97.90%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)157.640 (+0.40%)159.272 (98.98%)
client-sv1-get-submit✅ (view plot)7044.700 (+4.56%)7113.769 (99.03%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)273.160 (-2.12%)293.717 (93.00%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle✅ (view plot)772.500 (+2.84%)791.505 (97.60%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)601.020 (-2.03%)640.202 (93.88%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)201.310 (-2.70%)220.876 (91.14%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented Mar 12, 2024

🐰Bencher

ReportWed, April 3, 2024 at 15:42:05 UTC
ProjectStratum v2 (SRI)
Branchtrigger-release-lib-automatically
Testbedsv2
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.508 (+0.20%)45.508 (97.80%)
client_sv2_handle_message_mining✅ (view plot)76.308 (+5.83%)81.135 (94.05%)
client_sv2_mining_message_submit_standard✅ (view plot)14.649 (+0.08%)14.849 (98.65%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)258.990 (-1.75%)282.299 (91.74%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)610.520 (+3.15%)627.127 (97.35%)
client_sv2_open_channel✅ (view plot)167.880 (+1.16%)175.526 (95.64%)
client_sv2_open_channel_serialize✅ (view plot)279.700 (-1.62%)298.001 (93.86%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)369.400 (-1.56%)405.936 (91.00%)
client_sv2_setup_connection✅ (view plot)162.230 (-0.88%)172.566 (94.01%)
client_sv2_setup_connection_serialize✅ (view plot)459.820 (-3.12%)505.260 (91.01%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)950.040 (-2.91%)1055.974 (89.97%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@Fi3
Copy link
Collaborator

Fi3 commented Mar 14, 2024

It would be nice to have a script that look at diff with main and for the crates that do diff, it run cargo release --dry run. So that we can run the script as an action before merging to main and spot if we forgot to change a version of a changed crate. (less thing to think about when we review release that is not bad)

@plebhash
Copy link
Collaborator Author

It would be nice to have a script that look at diff with main and for the crates that do diff, it run cargo release --dry run. So that we can run the script as an action before merging to main and spot if we forgot to change a version of a changed crate. (less thing to think about when we review release that is not bad)

that's a good idea, I'll write a new script and add to this PR

@plebhash plebhash force-pushed the trigger-release-lib-automatically branch 2 times, most recently from 4c6ac21 to 7e7c94b Compare March 15, 2024 20:10
@plebhash

This comment was marked as resolved.

@plebhash plebhash force-pushed the trigger-release-lib-automatically branch from 83733a8 to 9e60c67 Compare March 15, 2024 21:44
@pavlenex pavlenex modified the milestones: Milestone 4, Milestone 5 Mar 19, 2024
Copy link
Collaborator

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

Great idea to have a script to check that before merging dev into main 👏

@plebhash plebhash force-pushed the trigger-release-lib-automatically branch 6 times, most recently from 48cef22 to 432ffae Compare April 2, 2024 21:35
@plebhash plebhash marked this pull request as ready for review April 2, 2024 21:56
@plebhash plebhash requested a review from GitGab19 April 2, 2024 22:13
Comment on lines +34 to +51
for crate in "${crates[@]}"; do
cd "$crate"

# Check if there were any changes between dev and main
git diff --quiet "origin/dev" "origin/main" -- .
if [ $? -ne 0 ]; then

# Check if crate versions on dev and main are identical
version_dev=$(git show origin/dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}')
version_main=$(git show origin/main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}')
if [ "$version_dev" = "$version_main" ]; then
echo "Changes detected in crate $crate between dev and main branches! Versions on dev and main branches are identical ($version_dev), so you should bump the crate version on dev before merging into main."
exit 1
fi
fi

cd - >/dev/null
done
Copy link
Collaborator Author

@plebhash plebhash Apr 2, 2024

Choose a reason for hiding this comment

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

here's an example of how this shell script will prevent us from merging to main if we forget to bump some crate's version on a PR from dev to main:

https://github.com/plebhash/stratum/actions/runs/8530384769/job/23368058479?pr=47#step:3:15

@plebhash
Copy link
Collaborator Author

plebhash commented Apr 2, 2024

release-libs.yaml is failing on CI with this error message:

please paste the token found on https://crates.io/me below
error: credential provider `cargo:token` failed action `login`

Caused by:
  please provide a non-empty token
Error: Process completed with exit code 101.

I suspect this is because this workflow is being triggered from my fork, which doesn't have the login info to crates.io configured.

Also, this failed workflow is not blocking the PR from being merged.

IMO I would ignore this and merge (if reviews ok). After merging, I can do a dummy PR from dev to main to see if this error remains (I suspect it won't).

@plebhash plebhash force-pushed the trigger-release-lib-automatically branch from 905710b to 2ca3bf0 Compare April 3, 2024 15:05
@plebhash plebhash changed the title release-libs.yaml automatically triggered on push to main release-libs.yaml automatically triggered on PRs to main Apr 3, 2024
@plebhash plebhash merged commit 1611cdb into stratum-mining:main Apr 3, 2024
13 of 14 checks passed
@plebhash plebhash deleted the trigger-release-lib-automatically branch April 3, 2024 19:48
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 this pull request may close these issues.

4 participants