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

Add semver check workflow yaml #985

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Conversation

Shourya742
Copy link
Contributor

resolves #974

Copy link
Contributor

github-actions bot commented Jun 20, 2024

🐰Bencher

ReportFri, August 9, 2024 at 23:03:51 UTC
ProjectStratum v2 (SRI)
Branchci-semver
Testbedsv1

🚨 2 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
serialize_deserialize_subscribeRAM Accesses (accesses)🚨 (view plot | view alert)322.00 (+1.06%)321.79 (100.06%)
serialize_submitRAM Accesses (accesses)🚨 (view plot | view alert)330.00 (+1.59%)329.66 (100.10%)

Click to view all benchmark results
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)8,553.00 (+1.31%)8,723.32 (98.05%)✅ (view plot)3,772.00 (+0.80%)3,853.18 (97.89%)✅ (view plot)5,293.00 (+0.87%)5,399.36 (98.03%)✅ (view plot)8.00 (+1.91%)10.36 (77.23%)✅ (view plot)92.00 (+2.05%)94.09 (97.77%)
get_submit✅ (view plot)95,706.00 (+0.16%)96,124.18 (99.56%)✅ (view plot)59,522.00 (+0.08%)59,768.55 (99.59%)✅ (view plot)85,501.00 (+0.11%)85,824.67 (99.62%)✅ (view plot)46.00 (-15.52%)62.99 (73.02%)✅ (view plot)285.00 (+1.01%)287.62 (99.09%)
get_subscribe✅ (view plot)8,072.00 (+1.17%)8,263.99 (97.68%)✅ (view plot)2,848.00 (+0.60%)2,936.80 (96.98%)✅ (view plot)3,982.00 (+0.66%)4,096.44 (97.21%)✅ (view plot)13.00 (-17.63%)20.27 (64.13%)✅ (view plot)115.00 (+2.06%)117.00 (98.29%)
serialize_authorize✅ (view plot)12,396.00 (+1.48%)12,511.70 (99.08%)✅ (view plot)5,343.00 (+0.56%)5,424.18 (98.50%)✅ (view plot)7,456.00 (+0.62%)7,562.64 (98.59%)✅ (view plot)8.00 (-24.53%)13.55 (59.04%)✅ (view plot)140.00 (+3.11%)140.67 (99.53%)
serialize_deserialize_authorize✅ (view plot)24,618.00 (+0.58%)24,712.80 (99.62%)✅ (view plot)9,950.00 (+0.48%)10,025.48 (99.25%)✅ (view plot)14,048.00 (+0.55%)14,151.41 (99.27%)✅ (view plot)35.00 (-3.63%)41.51 (84.32%)✅ (view plot)297.00 (+0.68%)297.99 (99.67%)
serialize_deserialize_handle_authorize✅ (view plot)30,256.00 (+0.33%)30,352.72 (99.68%)✅ (view plot)12,127.00 (+0.25%)12,208.18 (99.34%)✅ (view plot)17,161.00 (+0.24%)17,277.18 (99.33%)✅ (view plot)64.00 (+8.78%)64.85 (98.69%)✅ (view plot)365.00 (+0.27%)367.50 (99.32%)
serialize_deserialize_handle_submit✅ (view plot)126,625.00 (+0.16%)127,022.16 (99.69%)✅ (view plot)73,307.00 (+0.07%)73,608.10 (99.59%)✅ (view plot)105,090.00 (+0.09%)105,496.67 (99.61%)✅ (view plot)114.00 (-5.00%)130.97 (87.05%)✅ (view plot)599.00 (+0.66%)599.62 (99.90%)
serialize_deserialize_handle_subscribe✅ (view plot)27,562.00 (+0.38%)27,603.74 (99.85%)✅ (view plot)9,650.00 (+0.18%)9,738.80 (99.09%)✅ (view plot)13,647.00 (+0.16%)13,771.75 (99.09%)✅ (view plot)67.00 (+2.06%)73.63 (91.00%)✅ (view plot)388.00 (+0.55%)388.64 (99.83%)
serialize_deserialize_submit✅ (view plot)115,337.00 (+0.21%)115,651.65 (99.73%)✅ (view plot)68,167.00 (+0.16%)68,396.86 (99.66%)✅ (view plot)97,842.00 (+0.19%)98,146.23 (99.69%)✅ (view plot)62.00 (-9.97%)75.73 (81.87%)✅ (view plot)491.00 (+0.56%)492.51 (99.69%)
serialize_deserialize_subscribe✅ (view plot)23,020.00 (+0.62%)23,112.87 (99.60%)✅ (view plot)8,209.00 (+0.27%)8,294.80 (98.97%)✅ (view plot)11,565.00 (+0.29%)11,679.87 (99.02%)✅ (view plot)37.00 (-5.29%)44.15 (83.80%)🚨 (view plot | view alert)322.00 (+1.06%)321.79 (100.06%)
serialize_submit✅ (view plot)100,117.00 (+0.22%)100,460.94 (99.66%)✅ (view plot)61,566.00 (+0.08%)61,817.66 (99.59%)✅ (view plot)88,347.00 (+0.10%)88,677.81 (99.63%)✅ (view plot)44.00 (-19.88%)63.40 (69.40%)🚨 (view plot | view alert)330.00 (+1.59%)329.66 (100.10%)
serialize_subscribe✅ (view plot)11,507.00 (+1.54%)11,613.23 (99.09%)✅ (view plot)4,195.00 (+0.41%)4,283.80 (97.93%)✅ (view plot)5,837.00 (+0.40%)5,955.23 (98.01%)✅ (view plot)14.00 (-12.95%)19.28 (72.63%)✅ (view plot)160.00 (+2.98%)160.29 (99.82%)

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

Copy link
Contributor

github-actions bot commented Jun 20, 2024

🐰Bencher

ReportFri, August 9, 2024 at 23:03:49 UTC
ProjectStratum v2 (SRI)
Branchci-semver
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common✅ (view plot)44.84 (+0.65%)45.23 (99.13%)
client_sv2_handle_message_mining✅ (view plot)74.83 (+2.54%)80.24 (93.26%)
client_sv2_mining_message_submit_standard✅ (view plot)14.65 (-0.09%)14.90 (98.32%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)277.67 (+4.83%)284.25 (97.69%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)598.12 (+0.72%)626.49 (95.47%)
client_sv2_open_channel✅ (view plot)166.78 (+0.55%)173.24 (96.27%)
client_sv2_open_channel_serialize✅ (view plot)269.95 (-4.45%)294.60 (91.63%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)371.28 (-1.74%)421.57 (88.07%)
client_sv2_setup_connection✅ (view plot)160.82 (-1.90%)174.49 (92.16%)
client_sv2_setup_connection_serialize✅ (view plot)460.29 (-2.62%)505.67 (91.03%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)948.35 (-2.43%)1,040.18 (91.17%)

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

Copy link
Contributor

github-actions bot commented Jun 20, 2024

🐰Bencher

ReportFri, August 9, 2024 at 23:03:50 UTC
ProjectStratum v2 (SRI)
Branch985/merge
Testbedsv1

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handleLatency (nanoseconds (ns))🚨 (view plot | view alert)788.99 (+5.11%)786.07 (100.37%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)6,548.80 (-4.89%)7,357.29 (89.01%)
client-submit-serialize-deserialize✅ (view plot)7,423.20 (-4.85%)8,338.21 (89.03%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,114.10 (-3.06%)8,846.49 (91.72%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)903.34 (+0.58%)924.99 (97.66%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)707.32 (+1.45%)717.47 (98.58%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)249.41 (+0.60%)254.76 (97.90%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)159.25 (+1.29%)162.26 (98.15%)
client-sv1-get-submit✅ (view plot)6,423.20 (-3.43%)7,135.58 (90.02%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)276.65 (-0.71%)290.83 (95.12%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle🚨 (view plot | view alert)788.99 (+5.11%)786.07 (100.37%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)640.11 (+3.90%)641.08 (99.85%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)209.34 (+1.43%)219.45 (95.39%)

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

Copy link
Contributor

github-actions bot commented Jun 20, 2024

🐰Bencher

ReportFri, August 9, 2024 at 23:03:50 UTC
ProjectStratum v2 (SRI)
Branchci-semver
Testbedsv2

🚨 8 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonEstimated Cycles (estimated cycles)🚨 (view plot | view alert)2,187.00 (+6.33%)2,150.69 (101.69%)
client_sv2_handle_message_commonRAM Accesses (accesses)🚨 (view plot | view alert)40.00 (+8.71%)39.11 (102.27%)
client_sv2_mining_message_submit_standard_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)10,591.00 (+0.42%)10,582.88 (100.08%)
client_sv2_mining_message_submit_standard_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)15,403.00 (+0.37%)15,394.67 (100.05%)
client_sv2_open_channel_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)8,027.00 (+0.48%)8,022.66 (100.05%)
client_sv2_open_channel_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)11,670.00 (+0.43%)11,667.42 (100.02%)
client_sv2_setup_connection_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)14,855.00 (+0.27%)14,850.37 (100.03%)
client_sv2_setup_connection_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)21,818.00 (+0.28%)21,807.78 (100.05%)

Click to view all benchmark results
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 | view alert)2,187.00 (+6.33%)2,150.69 (101.69%)✅ (view plot)473.00 (+0.45%)485.94 (97.34%)✅ (view plot)727.00 (-0.67%)754.00 (96.42%)✅ (view plot)12.00 (+62.01%)12.10 (99.18%)🚨 (view plot | view alert)40.00 (+8.71%)39.11 (102.27%)
client_sv2_handle_message_mining✅ (view plot)8,235.00 (+0.43%)8,334.73 (98.80%)✅ (view plot)2,143.00 (+0.68%)2,171.47 (98.69%)✅ (view plot)3,170.00 (+0.74%)3,216.28 (98.56%)✅ (view plot)33.00 (-13.51%)43.91 (75.15%)✅ (view plot)140.00 (+0.77%)141.97 (98.61%)
client_sv2_mining_message_submit_standard✅ (view plot)6,362.00 (+1.32%)6,395.88 (99.47%)✅ (view plot)1,756.00 (+0.34%)1,763.45 (99.58%)✅ (view plot)2,557.00 (+0.12%)2,575.22 (99.29%)✅ (view plot)19.00 (+6.76%)23.33 (81.43%)✅ (view plot)106.00 (+2.02%)107.10 (98.97%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,869.00 (+0.63%)15,034.50 (98.90%)✅ (view plot)4,700.00 (+0.13%)4,707.45 (99.84%)✅ (view plot)6,759.00 (+0.06%)6,774.87 (99.77%)✅ (view plot)47.00 (-1.03%)52.98 (88.71%)✅ (view plot)225.00 (+1.17%)230.02 (97.82%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,663.00 (+0.64%)27,850.20 (99.33%)🚨 (view plot | view alert)10,591.00 (+0.42%)10,582.88 (100.08%)🚨 (view plot | view alert)15,403.00 (+0.37%)15,394.67 (100.05%)✅ (view plot)86.00 (+2.40%)89.82 (95.75%)✅ (view plot)338.00 (+0.93%)345.15 (97.93%)
client_sv2_open_channel✅ (view plot)4,349.00 (-2.91%)4,619.63 (94.14%)✅ (view plot)1,461.00 (+0.05%)1,473.88 (99.13%)✅ (view plot)2,159.00 (+0.26%)2,173.06 (99.35%)✅ (view plot)11.00 (-7.02%)15.12 (72.77%)✅ (view plot)61.00 (-5.81%)68.50 (89.05%)
client_sv2_open_channel_serialize✅ (view plot)14,050.00 (-1.05%)14,461.00 (97.16%)✅ (view plot)5,064.00 (+0.01%)5,076.88 (99.75%)✅ (view plot)7,325.00 (+0.09%)7,339.26 (99.81%)✅ (view plot)36.00 (-3.67%)42.70 (84.30%)✅ (view plot)187.00 (-2.22%)198.97 (93.99%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,685.00 (+0.21%)23,007.91 (98.60%)🚨 (view plot | view alert)8,027.00 (+0.48%)8,022.66 (100.05%)🚨 (view plot | view alert)11,670.00 (+0.43%)11,667.42 (100.02%)✅ (view plot)82.00 (+10.89%)83.56 (98.13%)✅ (view plot)303.00 (-0.40%)314.54 (96.33%)
client_sv2_setup_connection✅ (view plot)4,715.00 (+0.39%)4,766.72 (98.91%)✅ (view plot)1,502.00 (+0.05%)1,514.88 (99.15%)✅ (view plot)2,275.00 (-0.07%)2,298.54 (98.98%)✅ (view plot)12.00 (+26.20%)14.63 (82.02%)✅ (view plot)68.00 (+0.33%)69.79 (97.43%)
client_sv2_setup_connection_serialize✅ (view plot)16,134.00 (-0.68%)16,507.66 (97.74%)✅ (view plot)5,963.00 (+0.01%)5,975.88 (99.78%)✅ (view plot)8,659.00 (+0.04%)8,677.46 (99.79%)✅ (view plot)46.00 (+2.61%)49.33 (93.25%)✅ (view plot)207.00 (-1.62%)218.14 (94.89%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,568.00 (+0.10%)35,743.24 (99.51%)🚨 (view plot | view alert)14,855.00 (+0.27%)14,850.37 (100.03%)🚨 (view plot | view alert)21,818.00 (+0.28%)21,807.78 (100.05%)✅ (view plot)97.00 (-2.72%)112.94 (85.88%)✅ (view plot)379.00 (-0.07%)384.87 (98.47%)

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

Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

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

How would this work in practice? Lets say I added a new breaking change, will the PR CI keep failing until I change the version accordingly?

@Shourya742
Copy link
Contributor Author

How would this work in practice? Lets say I added a new breaking change, will the PR CI keep failing until I change the version accordingly?

The semver check in our CI pipeline ensures that all modifications to the codebase comply with semantic versioning rules. If a breaking change is introduced without the corresponding version increment, the CI will fail.

@jbesraa
Copy link
Contributor

jbesraa commented Jun 20, 2024

IIUC we should run this only on versioned branches. I think our release branch is main, so maybe we should run this only when a PR base is main ? Not sure though, Ill let @Fi3 chime in as he opened the issue

@pavlenex pavlenex linked an issue Jun 20, 2024 that may be closed by this pull request
@plebhash
Copy link
Collaborator

plebhash commented Jun 20, 2024

here's a summary of our current strategy for semver quality control (which is admitedly suboptimal, so this contribution is very desired)

we have check-versioning-lib-release.sh which is called from .github/workflows/release-libs.yaml every time we are trying to merge from dev to main

if the script returns 1, CI breaks and merging from dev to main is blocked

the script will return 1 if:

  • some crate was changed since the latest release
  • its version wasn't bumped

basically this is a safety check for releases, but implemented in a very suboptimal way

one of the undesired consequences is that even small cosmetic changes (e.g.: PR #915) impose that crates versioning must be bumped, which is not ideal

in summary, whenever we're merging from dev to main, our goal is:

  • breaking changes to any of the crates published to crates.io (list can be found at .github/workflows/release-libs.yaml) must follow SemVer 2.0 (as described in RELEASE.md)
  • non-breaking changes (e.g.: README.md, code formatting, docs, etc) are not taken into consideration

I believe we will be able to achieve this vision by replacing check-versioning-lib-release.sh and leveraging cargo semver-checks over this new CI .github/workflows/semver-check.yaml

@jbesraa
Copy link
Contributor

jbesraa commented Jun 21, 2024

Thanks @plebhash thats very helpful. @Shourya742 So I think you are half way through, lets just replace the old check with the new one as @plebhash mentioned.

@jbesraa
Copy link
Contributor

jbesraa commented Jun 21, 2024

Note here: cargo-semver relies on the result of rustdoc in order to notify about semver breaches, i.e. it reads the docs we write and emit notifications accordingly. As our docs are not great yet, cargo-semver might not produce the results we want. Nonetheless, I think we should add it, use it as an additional check, and once we have robust docs we can rely on it solely. cc @Fi3

@plebhash

This comment was marked as outdated.

@Shourya742
Copy link
Contributor Author

Note here: cargo-semver relies on the result of rustdoc in order to notify about semver breaches, i.e. it reads the docs we write and emit notifications accordingly. As our docs are not great yet, cargo-semver might not produce the results we want. Nonetheless, I think we should add it, use it as an additional check, and once we have robust docs we can rely on it solely. cc @Fi3

in other words: this is currently blocked by #845

cargo-semver is designed to ensure semantic versioning (semver) compatibility by analyzing the public API of a Rust crate. . Importantly, cargo-semver does not rely on rustdoc or the quality of the documentation to detect these breaches. In our case, because the jd-server and jd-client crates in roles are not published on crates.io, we utilize the cargo-semver-checks --baseline-root . command. This command allows us to specify the local directory as the baseline for semver checks, enabling us to manage version compatibility internally for our unpublished crates.

Copy link
Collaborator

@rrybarczyk rrybarczyk left a comment

Choose a reason for hiding this comment

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

Some suggestions to help improve efficiency and try and avoid issues when non-code logic is changed (like README.mds).

.github/workflows/semver-check.yaml Outdated Show resolved Hide resolved
.github/workflows/semver-check.yaml Outdated Show resolved Hide resolved
.github/workflows/semver-check.yaml Outdated Show resolved Hide resolved
.github/workflows/semver-check.yaml Show resolved Hide resolved
.github/workflows/semver-check.yaml Show resolved Hide resolved
.github/workflows/semver-check.yaml Outdated Show resolved Hide resolved
@rrybarczyk
Copy link
Collaborator

Do we want to add this workflow to the .githooks/pre-push script?

@jbesraa
Copy link
Contributor

jbesraa commented Jun 24, 2024

Note here: cargo-semver relies on the result of rustdoc in order to notify about semver breaches, i.e. it reads the docs we write and emit notifications accordingly. As our docs are not great yet, cargo-semver might not produce the results we want. Nonetheless, I think we should add it, use it as an additional check, and once we have robust docs we can rely on it solely. cc @Fi3

in other words: this is currently blocked by #845

cargo-semver is designed to ensure semantic versioning (semver) compatibility by analyzing the public API of a Rust crate. . Importantly, cargo-semver does not rely on rustdoc or the quality of the documentation to detect these breaches. In our case, because the jd-server and jd-client crates in roles are not published on crates.io, we utilize the cargo-semver-checks --baseline-root . command. This command allows us to specify the local directory as the baseline for semver checks, enabling us to manage version compatibility internally for our unpublished crates.

https://github.com/obi1kenobi/cargo-semver-checks/blob/main/README.md#how-is-cargo-semver-checks-similar-to-and-different-from-other-tools (third paragraph)

--baseline-root based on the docs this flag is used for getting the older version number

@Fi3
Copy link
Collaborator

Fi3 commented Jun 25, 2024

Note here: cargo-semver relies on the result of rustdoc in order to notify about semver breaches, i.e. it reads the docs we write and emit notifications accordingly. As our docs are not great yet, cargo-semver might not produce the results we want. Nonetheless, I think we should add it, use it as an additional check, and once we have robust docs we can rely on it solely. cc @Fi3

in other words: this is currently blocked by #845

cargo-semver is designed to ensure semantic versioning (semver) compatibility by analyzing the public API of a Rust crate. . Importantly, cargo-semver does not rely on rustdoc or the quality of the documentation to detect these breaches. In our case, because the jd-server and jd-client crates in roles are not published on crates.io, we utilize the cargo-semver-checks --baseline-root . command. This command allows us to specify the local directory as the baseline for semver checks, enabling us to manage version compatibility internally for our unpublished crates.

https://github.com/obi1kenobi/cargo-semver-checks/blob/main/README.md#how-is-cargo-semver-checks-similar-to-and-different-from-other-tools (third paragraph)

--baseline-root based on the docs this flag is used for getting the older version number

not sure that I get the issue here. It say that the default option is to use the version of what is published on crates.io

Copy link
Collaborator

@rrybarczyk rrybarczyk left a comment

Choose a reason for hiding this comment

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

lgtm

@jbesraa
Copy link
Contributor

jbesraa commented Jul 10, 2024

Note here: cargo-semver relies on the result of rustdoc in order to notify about semver breaches, i.e. it reads the docs we write and emit notifications accordingly. As our docs are not great yet, cargo-semver might not produce the results we want. Nonetheless, I think we should add it, use it as an additional check, and once we have robust docs we can rely on it solely. cc @Fi3

in other words: this is currently blocked by #845

cargo-semver is designed to ensure semantic versioning (semver) compatibility by analyzing the public API of a Rust crate. . Importantly, cargo-semver does not rely on rustdoc or the quality of the documentation to detect these breaches. In our case, because the jd-server and jd-client crates in roles are not published on crates.io, we utilize the cargo-semver-checks --baseline-root . command. This command allows us to specify the local directory as the baseline for semver checks, enabling us to manage version compatibility internally for our unpublished crates.

https://github.com/obi1kenobi/cargo-semver-checks/blob/main/README.md#how-is-cargo-semver-checks-similar-to-and-different-from-other-tools (third paragraph)
--baseline-root based on the docs this flag is used for getting the older version number

not sure that I get the issue here. It say that the default option is to use the version of what is published on crates.io

The question is how it knows there is a major breaking change between lets say 1.0 and 1.1 and notify about it. its doing so by inspecting the docs.

@Shourya742
Copy link
Contributor Author

@jbesraa Yes, the semver check analyzes the documentation to understand the previous API behavior and detect any breaking changes in the current version. If you introduce a breaking change, the PR CI will fail until you update the version number accordingly, usually by incrementing the major version.

@jbesraa
Copy link
Contributor

jbesraa commented Jul 10, 2024

@jbesraa Yes, the semver check analyzes the documentation to understand the previous API behavior and detect any breaking changes in the current version. If you introduce a breaking change, the PR CI will fail until you update the version number accordingly, usually by incrementing the major version.

Yup. which makes this not great for this project(at this point) because we dont have(enough) docs and the API is not stablised yet

@Fi3
Copy link
Collaborator

Fi3 commented Jul 10, 2024

@jbesraa Yes, the semver check analyzes the documentation to understand the previous API behavior and detect any breaking changes in the current version. If you introduce a breaking change, the PR CI will fail until you update the version number accordingly, usually by incrementing the major version.

Yup. which makes this not great for this project(at this point) because we dont have docs and the API is not 'stablised' yet

I don't know the internals of it. But rust doc are automatically generated, and you get an entrance for everything that is exported by the library. I'm pretty sure that it do not need us to write actual docs in order to work.

API is stabilized and if we change it we MUST updated the version accordingly.

@Shourya742
Copy link
Contributor Author

@jbesraa , that's precisely the point. We've already done a major release (version 1), and the APIs should not change. If there is any breaking change, a version bump is necessary. However, I believe @plebhash might be the right person to ask about this.

@Fi3
Copy link
Collaborator

Fi3 commented Jul 10, 2024

@jbesraa , that's precisely the point. We've already done a major release (version 1), and the APIs should not change. If there is any breaking change, a version bump is necessary. However, I believe @plebhash might be the right person to ask about this.

any patch / bug that do not introduce new feature or remove old one MUST be a patch version bump
any new feature MUST be a minor version bump
anything that break compatibility MUST be a majior version bump

This is very important, there are other project out there that use SRI, and since cargo when building a project follow semver, if we do not do it will have build errors!

@jbesraa
Copy link
Contributor

jbesraa commented Jul 10, 2024

Sorry maybe I am not explaining myself here

What iam trying to say is that this tool relies on rust-docs(we should write the docs) and while we dont have enough/good docs we might get alot of false alarms because the code is ahead of the code docs..

@Fi3
Copy link
Collaborator

Fi3 commented Jul 10, 2024

Sorry maybe I am not explaining myself here

What iam trying to say is that this tool relies on rust-docs(we should write the docs) and while we dont have enough/good docs we might get alot of false alarms because the code is ahead of the code docs..

docs are automatically generated you don't need to write them

@plebhash
Copy link
Collaborator

plebhash commented Jul 10, 2024

I should point out that I'm not 100% confident on what I said here: #985 (comment) so I hid the comment to avoid making things more confusing than necessary

I'd like to ask to everyone (especially @jbesraa ) to take this comment with a grain of salt, it might be the case that we're not necessarily blocked by #845

it seems there's some confusion with regards to how cargo-semver-checks works and how it will fill our needs, and unfortunately the project's FAQ on the README doesn't seem to be fully answering all our questions.

I'm taking some time to study the following resources, which hopefully will allow for more well-informed decisions:

@Shourya742
Copy link
Contributor Author

@plebhash Done. I cherry-picked the commit. Thanks for the detailed review and testing.

@plebhash

This comment was marked as resolved.

plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
@rrybarczyk rrybarczyk self-requested a review August 9, 2024 14:28
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
plebhash added a commit to plebhash/stratum that referenced this pull request Aug 9, 2024
@plebhash plebhash force-pushed the ci-semver branch 2 times, most recently from 3a673c6 to 9fffa54 Compare August 9, 2024 21:02
@plebhash plebhash merged commit 2541703 into stratum-mining:dev Aug 9, 2024
33 checks passed
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.

Add semver checks to CI
5 participants