-
Notifications
You must be signed in to change notification settings - Fork 21
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/cargo publish on release #569
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA comprehensive update has been made to various configuration files and Rust packages within the project. Key changes include enhanced GitHub Actions workflows for release and publishing, updated metadata in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
size-limit report 📦
|
cd94b06
to
caad5fc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
d885e81
to
aac40dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- .github/workflows/release.yml (1 hunks)
- Cargo.toml (2 hunks)
- contracts/axone-cognitarium/Cargo.toml (1 hunks)
- contracts/axone-dataverse/Cargo.toml (1 hunks)
- contracts/axone-law-stone/Cargo.toml (1 hunks)
- contracts/axone-objectarium/Cargo.toml (1 hunks)
- packages/axone-cognitarium-client/Cargo.toml (1 hunks)
- packages/axone-logic-bindings/Cargo.toml (1 hunks)
- packages/axone-objectarium-client/Cargo.toml (1 hunks)
- packages/axone-rdf/Cargo.toml (1 hunks)
- packages/axone-wasm/Cargo.toml (1 hunks)
- packages/axone-wasm/README.md (1 hunks)
Files skipped from review due to trivial changes (8)
- contracts/axone-cognitarium/Cargo.toml
- contracts/axone-law-stone/Cargo.toml
- contracts/axone-objectarium/Cargo.toml
- packages/axone-cognitarium-client/Cargo.toml
- packages/axone-objectarium-client/Cargo.toml
- packages/axone-rdf/Cargo.toml
- packages/axone-wasm/Cargo.toml
- packages/axone-wasm/README.md
Additional comments not posted (6)
packages/axone-logic-bindings/Cargo.toml (2)
2-11
: LGTM! The addition of comprehensive metadata fields enhances the package's visibility and manageability on crates.io.
Line range hint
13-23
: Consider ensuring consistency in the specification of dependency versions across the workspace, particularly forform_urlencoded
andurl
.Verification successful
Dependency versions for
form_urlencoded
andurl
are consistently specified across the workspace.
form_urlencoded = "1.2.1"
is found in:
packages/axone-wasm/Cargo.toml
packages/axone-logic-bindings/Cargo.toml
url = "2.5.0"
is found in:
packages/axone-wasm/Cargo.toml
packages/axone-logic-bindings/Cargo.toml
contracts/axone-law-stone/Cargo.toml
contracts/axone-dataverse/Cargo.toml
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for consistency in dependency versions across the workspace. # Test: Search for `form_urlencoded` and `url` versions across all Cargo.toml files. Expect: Consistent versioning. rg --type toml $'form_urlencoded = "1.2.1"' rg --type toml $'url = "2.5.0"'Length of output: 403
Cargo.toml (2)
5-9
: The updated workspace package metadata is well-defined and enhances project management.
24-32
: Ensure that the update to version "5.0.0" for all internal dependencies is well-coordinated with dependent projects or modules to manage potential breaking changes.contracts/axone-dataverse/Cargo.toml (1)
2-11
: Excellent addition of metadata fields to enhance the contract's visibility and manageability on crates.io..github/workflows/release.yml (1)
80-99
: The setup for CMake and the automated publishing steps usingcargo smart-release
are well-integrated into the release workflow. Ensure that environment variables and secrets likeCARGO_REGISTRY_TOKEN
are securely managed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for solving the crucial need of publishing those crates!
I appreciated your analysis in description it truly helps the review. I've made some remarks I'd be happy to discuss :)
.github/workflows/release.yml
Outdated
with: | ||
cmake-version: "3.29.0" | ||
|
||
- name: Publish crates to crates.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The publication should be part of its own workflow I guess, to separate the release from the publish. And this workflow could be triggered by the addition of a new tag.
] } | ||
axone-cognitarium-client = { path = "packages/axone-cognitarium-client" } | ||
axone-logic-bindings = { path = "packages/axone-logic-bindings" } | ||
], version = "5.0.0" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need of duplicating the version here, but it brings a new responsibility that is not managed here, this version must be in sync the new released versions. And sadly cargo doesn't come with CLI tools to achieved that 😢..
Currently at release each contracts & packages have their version updated by semantic release, this is configured in the .releaserc.yml. However this replace plugin isn't suitable to update versions in the dependency list..
I think we could easily script this update using toml-cli, for example:
toml set Cargo.toml workspace.dependencies.axone-rdf.version 4.1.0
I think the changes made by toml-cli
may need to be properly formatted to please the linter, and committed in the release commit.
All this logic may be embedded in a new task in the Makefile.toml
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ErikssonJoakim for the very insightful analysis and preliminary implementation to tackle this issue.
After delving deeper into the issue, I wonder if we could leverage the cargo-workspaces tool. AFAIS, this tool offers several features, including:
- Bumping the versions of all crates, which serves as an alternative to what the semantic-release-replace-plugin of semantic-release does.
For instance:
➜ cargo workspaces version --no-git-commit -y custom 6.0.0
info looking for changes since v5.0.0
info current common version 5.0.0
Changes:
- axone-cognitarium: 5.0.0 => 6.0.0
- axone-dataverse: 5.0.0 => 6.0.0
- axone-law-stone: 5.0.0 => 6.0.0
- axone-objectarium: 5.0.0 => 6.0.0
- axone-cognitarium-client: 5.0.0 => 6.0.0
- axone-logic-bindings: 5.0.0 => 6.0.0
- axone-objectarium-client: 5.0.0 => 6.0.0
- axone-rdf: 5.0.0 => 6.0.0
- axone-wasm: 5.0.0 => 6.0.0
NB: toml-cli proposed by @amimart is also a good solution.
- Publishing artifacts in the correct order according to dependencies (according to docs). It’s something to test (which I haven’t done yet), but I've a feeling it could meet our needs, or at least serve as a foundation to build upon.
what do you think ?
aac40dd
to
0eb2748
Compare
Thanks for the feedback @ccamel @amimart , as you point out the versioning is not correctly handled. I've taken into consideration your suggestions and I think the simplest way to handle the versioning is to keep the current system and build upon it as you suggest. I've tried cargo-workspaces to publish but found it unsatisfactory as it basically has the same problems as smart-release, requiring versioning on workspace dependencies. As expected the toml-cli does not support outputting to file while keeping the format and therefore I am using this unix command trick where I create a temporary file to preserve the format. See below for task result I'm sorry for the delay to respond, work and private life got in the way 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- .github/workflows/publish.yml (1 hunks)
- .releaserc.yml (1 hunks)
- Cargo.toml (2 hunks)
- Makefile.toml (2 hunks)
- contracts/axone-cognitarium/Cargo.toml (1 hunks)
- contracts/axone-dataverse/Cargo.toml (1 hunks)
- contracts/axone-law-stone/Cargo.toml (1 hunks)
- contracts/axone-objectarium/Cargo.toml (1 hunks)
- packages/axone-cognitarium-client/Cargo.toml (1 hunks)
- packages/axone-logic-bindings/Cargo.toml (1 hunks)
- packages/axone-objectarium-client/Cargo.toml (1 hunks)
- packages/axone-rdf/Cargo.toml (1 hunks)
- packages/axone-wasm/Cargo.toml (1 hunks)
- packages/axone-wasm/README.md (1 hunks)
Files skipped from review due to trivial changes (7)
- contracts/axone-cognitarium/Cargo.toml
- contracts/axone-dataverse/Cargo.toml
- contracts/axone-objectarium/Cargo.toml
- packages/axone-logic-bindings/Cargo.toml
- packages/axone-objectarium-client/Cargo.toml
- packages/axone-rdf/Cargo.toml
- packages/axone-wasm/README.md
Additional comments not posted (43)
packages/axone-cognitarium-client/Cargo.toml (5)
2-2
: Ensure theauthors.workspace
field is correctly set.The
authors.workspace = true
line indicates that the authors are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the authors.Verification successful
The
authors.workspace
field is correctly set.The workspace configuration specifies the authors as
["AXONE"]
, which appears to be correct.
packages/axone-cognitarium-client/Cargo.toml
:authors.workspace = true
- Workspace
Cargo.toml
:authors = ["AXONE"]
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the authors. # Test: Check the authors field in the workspace Cargo.toml. Expect: Correct authors specified. rg --type toml $'authors = ' Cargo.tomlLength of output: 60
7-8
: Ensure thehomepage.workspace
andlicense-file.workspace
fields are correctly set.The
homepage.workspace = true
andlicense-file.workspace = true
lines indicate that these fields are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the homepage and license file.Verification successful
Ensure the
homepage.workspace
andlicense-file.workspace
fields are correctly set.The
homepage
andlicense-file
fields are correctly specified in the Cargo.toml file:
homepage = "https://axone.xyz/"
license-file = "LICENSE"
These fields are inherited from the workspace configuration as indicated by
homepage.workspace = true
andlicense-file.workspace = true
.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the homepage and license file. # Test: Check the homepage and license-file fields in the workspace Cargo.toml. Expect: Correct homepage and license file specified. rg --type toml $'homepage = ' Cargo.toml rg --type toml $'license-file = ' Cargo.tomlLength of output: 144
10-11
: Verify thereadme
andrepository
fields.Ensure that the
readme
andrepository
fields are accurate and reflect the package's documentation and repository location correctly.Verification successful
The
readme
andrepository
fields have been verified and are accurate.
- The
README.md
file exists in the specified location.- The repository URL is valid and reachable.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the readme and repository fields are accurate. # Test: Check the readme and repository fields in the Cargo.toml. Expect: Accurate readme and repository location. rg --type toml $'readme = ' packages/axone-cognitarium-client/Cargo.toml rg --type toml $'repository = ' packages/axone-cognitarium-client/Cargo.tomlLength of output: 275
Script:
#!/bin/bash # Check if the README.md file exists in the specified location if [ -f packages/axone-cognitarium-client/README.md ]; then echo "README.md exists" else echo "README.md does not exist" fi # Validate the repository URL by checking its reachability if curl --output /dev/null --silent --head --fail "https://github.com/axone-protocol/contracts/tree/main/packages/axone-cognitarium-client"; then echo "Repository URL is valid" else echo "Repository URL is invalid" fiLength of output: 293
14-14
: Ensure theaxone-cognitarium.workspace
field is correctly set.The
axone-cognitarium.workspace = true
line indicates that the dependency is inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the dependency.Verification successful
The
axone-cognitarium.workspace
field is correctly set.
- The field
axone-cognitarium.workspace = true
is present inpackages/axone-cognitarium-client/Cargo.toml
andcontracts/axone-dataverse/Cargo.toml
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the axone-cognitarium dependency. # Test: Check the axone-cognitarium dependency in the workspace Cargo.toml. Expect: Correct axone-cognitarium dependency specified. rg --type toml $'axone-cognitarium = ' Cargo.tomlLength of output: 123
Script:
#!/bin/bash # Description: Verify that the axone-cognitarium.workspace field is correctly set in the workspace configuration. # Test: Check if the axone-cognitarium.workspace = true is specified in the workspace Cargo.toml. rg --type toml 'axone-cognitarium.workspace = true' Cargo.tomlLength of output: 64
Script:
#!/bin/bash # Description: Verify that the axone-cognitarium.workspace field is correctly set in the workspace configuration. # Test: Check all Cargo.toml files for any mention of axone-cognitarium to ensure comprehensive verification. rg --type toml 'axone-cognitarium' --glob '**/Cargo.toml'Length of output: 1047
3-4
: Verify thecategories
anddescription
fields.Ensure that the
categories
anddescription
fields are accurate and reflect the package's purpose correctly.packages/axone-wasm/Cargo.toml (6)
2-2
: Ensure theauthors.workspace
field is correctly set.The
authors.workspace = true
line indicates that the authors are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the authors.Verification successful
The
authors.workspace
field is correctly set.The workspace configuration specifies the authors as
["AXONE"]
, and theauthors.workspace = true
line in the package'sCargo.toml
correctly inherits this value.
Cargo.toml
(workspace):authors = ["AXONE"]
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the authors. # Test: Check the authors field in the workspace Cargo.toml. Expect: Correct authors specified. rg --type toml $'authors = ' Cargo.tomlLength of output: 60
11-12
: Ensure thehomepage.workspace
andlicense-file.workspace
fields are correctly set.The
homepage.workspace = true
andlicense-file.workspace = true
lines indicate that these fields are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the homepage and license file.Verification successful
Verification successful: The
homepage.workspace
andlicense-file.workspace
fields are correctly set in the workspace configuration.
homepage
is set to "https://axone.xyz/"license-file
is set to "LICENSE"Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the homepage and license file. # Test: Check the homepage and license-file fields in the workspace Cargo.toml. Expect: Correct homepage and license file specified. rg --type toml $'homepage = ' Cargo.toml rg --type toml $'license-file = ' Cargo.tomlLength of output: 144
8-9
: Verify thedescription
field.Ensure that the
description
field is accurate and reflects the package's purpose correctly.Verification successful
The
description
field is accurate.The description in the Cargo.toml file matches the one in the README file, confirming that it accurately reflects the package's purpose.
Cargo.toml
description: "Package that holds useful components to manage withCosmWasm
data, typically reading / writing."- README description: "Package that holds useful components to manage with
CosmWasm
data, typically reading / writing."Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the description field is accurate. # Test: Check the description field in the Cargo.toml. Expect: Accurate description. rg --type toml $'description = ' packages/axone-wasm/Cargo.tomlLength of output: 178
Script:
#!/bin/bash # Find and display the contents of the README file or other relevant documentation files within the packages/axone-wasm directory. fd -e md -e txt -e rst -e adoc -e org --search-path packages/axone-wasm/ | xargs catLength of output: 192
14-15
: Verify thereadme
andrepository
fields.Ensure that the
readme
andrepository
fields are accurate and reflect the package's documentation and repository location correctly.Verification successful
The
readme
andrepository
fields are accurate.
- The
README.md
file exists in thepackages/axone-wasm
directory.- The repository URL follows a valid GitHub URL structure.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the readme and repository fields are accurate. # Test: Check the readme and repository fields in the Cargo.toml. Expect: Accurate readme and repository location. rg --type toml $'readme = ' packages/axone-wasm/Cargo.toml rg --type toml $'repository = ' packages/axone-wasm/Cargo.tomlLength of output: 233
Script:
#!/bin/bash # Check if the README.md file exists in the packages/axone-wasm directory if [ -f packages/axone-wasm/README.md ]; then echo "README.md exists" else echo "README.md does not exist" fiLength of output: 85
3-7
: Verify thecategories
field.Ensure that the
categories
field is accurate and reflects the package's purpose correctly.Verification successful
The
categories
field is accurate.The categories listed in the
Cargo.toml
file reflect the package's purpose of managingCosmWasm
data, typically involving cryptographic, parsing, and data structure functionalities.
- Categories:
- "cryptography::cryptocurrencies"
- "parser-implementations"
- "data-structures"
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the categories field is accurate. # Test: Check the categories field in the Cargo.toml. Expect: Accurate categories. rg --type toml $'categories = ' packages/axone-wasm/Cargo.tomlLength of output: 78
Script:
#!/bin/bash # Description: Extract the package description and categories from the Cargo.toml file for verification. # Extract the package description rg --type toml 'description = ' packages/axone-wasm/Cargo.toml # Extract the categories field rg --type toml 'categories = ' -A 3 packages/axone-wasm/Cargo.tomlLength of output: 347
17-17
: Ensure thecosmwasm-std.workspace
field is correctly set.The
cosmwasm-std.workspace = true
line indicates that the dependency is inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the dependency.Verification successful
The
cosmwasm-std.workspace
field is correctly set.
- The
cosmwasm-std.workspace = true
line is present in theCargo.toml
file of theaxone-wasm
package.- The workspace configuration is correctly specified in the workspace
Cargo.toml
file.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the cosmwasm-std dependency. # Test: Check the cosmwasm-std dependency in the workspace Cargo.toml. Expect: Correct cosmwasm-std dependency specified. rg --type toml $'cosmwasm-std = ' Cargo.tomlLength of output: 111
Script:
#!/bin/bash # Description: Verify the presence of the `cosmwasm-std.workspace = true` line in the `Cargo.toml` file of the `axone-wasm` package and check the workspace configuration. # Test 1: Check for the `cosmwasm-std.workspace = true` line in the `Cargo.toml` file of the `axone-wasm` package. rg --type toml 'cosmwasm-std.workspace = true' packages/axone-wasm/Cargo.toml # Test 2: Check the workspace configuration in the workspace `Cargo.toml` file. rg --type toml '\[workspace\]' Cargo.tomlLength of output: 165
Cargo.toml (2)
5-8
: Verify theauthors
,homepage
, andlicense-file
fields in the workspace configuration.Ensure that the
authors
,homepage
, andlicense-file
fields are correctly specified in the workspace configuration.Verification successful
The
authors
,homepage
, andlicense-file
fields are correctly specified in the workspace configuration.
authors = ["AXONE"]
homepage = "https://axone.xyz/"
license-file = "LICENSE"
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the authors, homepage, and license-file fields are correctly specified in the workspace configuration. # Test: Check the authors, homepage, and license-file fields in the workspace Cargo.toml. Expect: Correct authors, homepage, and license file specified. rg --type toml $'authors = ' Cargo.toml rg --type toml $'homepage = ' Cargo.toml rg --type toml $'license-file = ' Cargo.tomlLength of output: 205
24-32
: Ensure the workspace dependencies are correctly set.The dependencies listed under
[workspace.dependencies]
should have the correct paths and versions specified. Verify that these dependencies are correctly set.Verification successful
Workspace dependencies are correctly set.
The paths, versions, and features for all dependencies in the Cargo.toml file are correctly specified.
axone-cognitarium
axone-cognitarium-client
axone-logic-bindings
axone-objectarium
axone-objectarium-client
axone-rdf
axone-wasm
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace dependencies are correctly set. # Test: Check the workspace dependencies in the Cargo.toml. Expect: Correct paths and versions specified. rg --type toml $'axone-cognitarium = ' Cargo.toml rg --type toml $'axone-cognitarium-client = ' Cargo.toml rg --type toml $'axone-logic-bindings = ' Cargo.toml rg --type toml $'axone-objectarium = ' Cargo.toml rg --type toml $'axone-objectarium-client = ' Cargo.toml rg --type toml $'axone-rdf = ' Cargo.toml rg --type toml $'axone-wasm = ' Cargo.tomlLength of output: 903
Script:
#!/bin/bash # Description: Verify the full details of axone-cognitarium and axone-objectarium dependencies in the Cargo.toml file. # Extract the dependency details for axone-cognitarium rg --type toml 'axone-cognitarium =' Cargo.toml -A 3 # Extract the dependency details for axone-objectarium rg --type toml 'axone-objectarium =' Cargo.toml -A 3Length of output: 513
contracts/axone-law-stone/Cargo.toml (5)
2-2
: Ensure theauthors.workspace
field is correctly set.The
authors.workspace = true
line indicates that the authors are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the authors.Verification successful
The
authors.workspace
field is correctly set.The workspace configuration specifies the authors as
["AXONE"]
, which will be inherited by thecontracts/axone-law-stone
package.
contracts/axone-law-stone/Cargo.toml
:authors.workspace = trueWorkspace
Cargo.toml
:authors = ["AXONE"]Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the authors. # Test: Check the authors field in the workspace Cargo.toml. Expect: Correct authors specified. rg --type toml $'authors = ' Cargo.tomlLength of output: 60
7-8
: Ensure thehomepage.workspace
andlicense-file.workspace
fields are correctly set.The
homepage.workspace = true
andlicense-file.workspace = true
lines indicate that these fields are inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the homepage and license file.Verification successful
The
homepage.workspace
andlicense-file.workspace
fields are correctly set.The workspace configuration specifies:
homepage = "https://axone.xyz/"
license-file = "LICENSE"
No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the homepage and license file. # Test: Check the homepage and license-file fields in the workspace Cargo.toml. Expect: Correct homepage and license file specified. rg --type toml $'homepage = ' Cargo.toml rg --type toml $'license-file = ' Cargo.tomlLength of output: 144
3-4
: Verify thecategories
anddescription
fields.Ensure that the
categories
anddescription
fields are accurate and reflect the package's purpose correctly.Verification successful
The
categories
anddescription
fields are accurate.The
categories
field["cryptography::cryptocurrencies"]
and thedescription
field"A CosmWasm Smart Contract which aims to provide GaaS (Governance as a Service) in any Cosmos blockchains."
in theCargo.toml
file accurately reflect the purpose and functionality of theaxone-law-stone
smart contract as described in theREADME.md
.
- The
description
field aligns with the overview provided in the README.- The
categories
field is appropriate given the context of the smart contract operating within the Cosmos blockchain ecosystem.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the categories and description fields are accurate. # Test: Check the categories and description fields in the Cargo.toml. Expect: Accurate categories and description. rg --type toml $'categories = ' contracts/axone-law-stone/Cargo.toml rg --type toml $'description = ' contracts/axone-law-stone/Cargo.tomlLength of output: 310
Script:
#!/bin/bash # Search for README files to cross-reference the purpose and functionality of the package. fd READMELength of output: 609
Script:
#!/bin/bash # Read the content of the README.md file to cross-reference the purpose and functionality of the package. cat contracts/axone-law-stone/README.mdLength of output: 1212
10-11
: Verify thereadme
andrepository
fields.Ensure that the
readme
andrepository
fields are accurate and reflect the package's documentation and repository location correctly.Verification successful
The
readme
andrepository
fields are accurate.
- The
README.md
file exists in thecontracts/axone-law-stone
directory.- The repository URL "https://github.com/axone-protocol/contracts/tree/main/contracts/axone-law-stone" is reachable.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the readme and repository fields are accurate. # Test: Check the readme and repository fields in the Cargo.toml. Expect: Accurate readme and repository location. rg --type toml $'readme = ' contracts/axone-law-stone/Cargo.toml rg --type toml $'repository = ' contracts/axone-law-stone/Cargo.tomlLength of output: 251
Script:
#!/bin/bash # Check if README.md exists in the contracts/axone-law-stone directory if [ -f contracts/axone-law-stone/README.md ]; then echo "README.md exists." else echo "README.md does not exist." fi # Verify the repository URL by checking if the URL is reachable repository_url="https://github.com/axone-protocol/contracts/tree/main/contracts/axone-law-stone" if curl --output /dev/null --silent --head --fail "$repository_url"; then echo "Repository URL is reachable." else echo "Repository URL is not reachable." fiLength of output: 386
14-14
: Ensure theaxone-logic-bindings.workspace
field is correctly set.The
axone-logic-bindings.workspace = true
line indicates that the dependency is inherited from the workspace configuration. Verify that the workspace configuration correctly specifies the dependency.Verification successful
Ensure the
axone-logic-bindings.workspace
field is correctly set.The workspace configuration correctly specifies the
axone-logic-bindings
dependency. Now, verify that theaxone-logic-bindings.workspace
field is set totrue
in thecontracts/axone-law-stone/Cargo.toml
file.
The
axone-logic-bindings.workspace
field is correctly set.
- The
axone-logic-bindings.workspace
field is set totrue
in thecontracts/axone-law-stone/Cargo.toml
file.- The workspace configuration correctly specifies the
axone-logic-bindings
dependency.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the workspace configuration correctly specifies the axone-logic-bindings dependency. # Test: Check the axone-logic-bindings dependency in the workspace Cargo.toml. Expect: Correct axone-logic-bindings dependency specified. rg --type toml $'axone-logic-bindings = ' Cargo.tomlLength of output: 138
Script:
#!/bin/bash # Description: Verify that the axone-logic-bindings.workspace field is correctly set to true in the contracts/axone-law-stone/Cargo.toml file. # Test: Check the axone-logic-bindings.workspace field in contracts/axone-law-stone/Cargo.toml. Expect: axone-logic-bindings.workspace = true. rg --type toml 'axone-logic-bindings.workspace = true' contracts/axone-law-stone/Cargo.tomlLength of output: 131
.github/workflows/publish.yml (8)
9-11
: Lint Job Configuration Looks GoodThe
lint
job is correctly configured to run on themain
branch and when the actor isbot-anik
.
13-15
: Build Job Configuration Looks GoodThe
build
job is correctly configured to run on themain
branch and when the actor isbot-anik
.
17-19
: Test Job Configuration Looks GoodThe
test
job is correctly configured to run on themain
branch and when the actor isbot-anik
.
29-32
: Repository Checkout Step Looks GoodThe step for checking out the repository using
actions/checkout@v4
is correctly configured.
34-40
: Rust Setup Step Looks GoodThe step for setting up Rust using
actions-rs/toolchain@v1
with toolchain version1.75
is correctly configured.
41-45
: CMake Setup Step Looks GoodThe step for setting up CMake using
jwlawson/actions-setup-cmake@v2
with version3.29.0
is correctly configured.
46-47
: Cargo Smart-Release Installation Step Looks GoodThe step for installing
cargo-smart-release
usingcargo install
is correctly configured.
49-62
: Crates Publishing Step Looks GoodThe step for publishing crates to crates.io using
cargo smart-release
with the appropriate options and environment variableCARGO_REGISTRY_TOKEN
is correctly configured..releaserc.yml (7)
Line range hint
4-8
: Commit Analyzer Plugin Configuration Looks GoodThe
@semantic-release/commit-analyzer
plugin is correctly configured with theconventionalcommits
preset and specific release rules.
Line range hint
9-10
: Release Notes Generator Plugin Configuration Looks GoodThe
@semantic-release/release-notes-generator
plugin is correctly configured with theconventionalcommits
preset.
Line range hint
11-13
: Changelog Plugin Configuration Looks GoodThe
@semantic-release/changelog
plugin is correctly configured to updateCHANGELOG.md
with the title# AXONE contracts
.
Line range hint
14-17
: Replace Plugin Configuration Looks GoodThe
semantic-release-replace-plugin
is correctly configured to update version numbers inCargo.toml
files.
Line range hint
18-22
: Exec Plugin Configuration Looks GoodThe
@semantic-release/exec
plugin is correctly configured to run several commands during the prepare step.
Line range hint
23-32
: GitHub Plugin Configuration Looks GoodThe
@semantic-release/github
plugin is correctly configured to upload assets and disable success comments.
Line range hint
33-37
: Git Plugin Configuration Looks GoodThe
@semantic-release/git
plugin is correctly configured to commit specific files with the message "chore(release): perform release ${nextRelease.version}".Makefile.toml (10)
603-614
: Workspace Dependency Versions Update Task Looks GoodThe task
update-workspace-dependency-versions
is correctly configured to update the version of workspace dependencies usingtoml-cli
.
615-615
: LLVM Tools Preview Installation Task Looks GoodThe task
install-llvm-tools-preview
is correctly configured to install thellvm-tools-preview
component.
616-616
: Clippy Installation Task Looks GoodThe task
install-clippy
is correctly configured to install theclippy
component.
617-617
: Cranky Installation Task Looks GoodThe task
install-cranky
is correctly configured to install thecranky
crate with a minimum version of0.3.0
.
618-618
: Rustfmt Installation Task Looks GoodThe task
install-rustfmt
is correctly configured to install therustfmt
component.
Line range hint
619-619
: Taplo CLI Installation Task Looks GoodThe task
install-taplo-cli
is correctly configured to install thetaplo-cli
crate with a minimum version of0.9.0
.
Line range hint
620-620
: Cargo Toml Lint Installation Task Looks GoodThe task
install-cargo-toml-lint
is correctly configured to install thecargo-toml-lint
crate with a minimum version of0.1.1
.
Line range hint
621-621
: LLVM Cov Installation Task Looks GoodThe task
install-llvm-cov
is correctly configured to install thecargo-llvm-cov
crate with a minimum version of0.6.9
and the--force
argument.
Line range hint
622-622
: CosmWasm Check Installation Task Looks GoodThe task
install-cosmwasm-check
is correctly configured to install thecosmwasm-check
crate with a minimum version of1.5.3
.
Line range hint
623-627
: Ffizer Installation Task Looks GoodThe task
install-ffizer
is correctly configured to ensureffizer
is installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @ErikssonJoakim, thank you!
One concern I have is the manual specification of crates for publication, which requires us to be vigilant about including any new packages or contracts. This can be managed for the publishing task if the order of crates is not critical, as per my suggestion. However, for the update-workspaces-versions
task, automating this process seems challenging, so we need to be careful 😓.
Let's see if this works seamlessly without a dry-run 🤞🙂.
.github/workflows/publish.yml
Outdated
- name: Cargo install smart-release | ||
run: cargo install cargo-smart-release | ||
|
||
- name: Publish crates to crates.io | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: | | ||
cargo smart-release --execute --update-crates-index --no-push --no-changelog --no-changelog-github-release \ | ||
axone-rdf \ | ||
axone-wasm \ | ||
axone-objectarium-client \ | ||
axone-logic-bindings \ | ||
axone-cognitarium-client \ | ||
axone-objectarium \ | ||
axone-cognitarium \ | ||
axone-law-stone \ | ||
axone-dataverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about putting this in a specific task inside Makefile.toml
, and call this task here ?
- name: Cargo install smart-release | |
run: cargo install cargo-smart-release | |
- name: Publish crates to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: | | |
cargo smart-release --execute --update-crates-index --no-push --no-changelog --no-changelog-github-release \ | |
axone-rdf \ | |
axone-wasm \ | |
axone-objectarium-client \ | |
axone-logic-bindings \ | |
axone-cognitarium-client \ | |
axone-objectarium \ | |
axone-cognitarium \ | |
axone-law-stone \ | |
axone-dataverse | |
- name: Publish crates to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: | | |
cargo make publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that's not a problem 🙂 I see it's the preferred way in the repository.
I've noticed however that publish is a keyword in cargo make, extending the cargo publish functionality, so the name of the task cannot be publish ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Altough creating a task opens the possibility to run this command locally, so installing cargo-smart-release is required.
This requires the system to have cmake already installed and I cannot find a satisfying way to install cmake on task invocation (installation depends on user operating system).
Best solution so far is to keep the cmake install in the workflow and if the user wants to run locally he'd have to install cmake. I could add a link to cmake download documentation in the pre-requisites part of the README.
.github/workflows/publish.yml
Outdated
cargo smart-release --execute --update-crates-index --no-push --no-changelog --no-changelog-github-release \ | ||
axone-rdf \ | ||
axone-wasm \ | ||
axone-objectarium-client \ | ||
axone-logic-bindings \ | ||
axone-cognitarium-client \ | ||
axone-objectarium \ | ||
axone-cognitarium \ | ||
axone-law-stone \ | ||
axone-dataverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another suggestion is to dynamically generate the list of crates to publish, avoiding forgetting future packages or smart contract creation. I don't know if the order is important, but if not, this should be good (I put in priority the packages list then contracts) 🙂.
cargo smart-release --execute --update-crates-index --no-push --no-changelog --no-changelog-github-release \ | |
axone-rdf \ | |
axone-wasm \ | |
axone-objectarium-client \ | |
axone-logic-bindings \ | |
axone-cognitarium-client \ | |
axone-objectarium \ | |
axone-cognitarium \ | |
axone-law-stone \ | |
axone-dataverse | |
PACKAGES=$(find packages contracts -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | tr '\n' ' ') | |
echo $PACKAGES | xargs cargo smart-release --execute --update-crates-index --no-push --no-changelog --no-changelog-github-release |
After further investigation of the cargo-smart-release crate I realise it does not support publishing crates without also handling the release. cargo-smart-release can decide not to publish a crate if it deems that the crate has already been published. This is done by checking the existence of release tags in the github repository. I'd say our best bet for publication is cargo workspaces, the tool @ccamel suggested for version control, although I am not able to correctly test the publication. cargo workspaces publish looks at the workspace manifest to decide which crates to publish. What do you think @ccamel @amimart @bdeneux ? Should we try out cargo workspaces? |
Makefile.toml
Outdated
|
||
[tasks.publish-crates] | ||
dependencies = ["install-cargo-workspaces"] | ||
script = "cargo workspaces publish --publish-as-is --allow-branch main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all version as already been bumped through releaserc previous steps in a release process, I'm wondering if you need to pass --from-git
argument avoiding execute cargo workspaces version
before publish, accordingly to the documentation ? (https://github.com/pksunkara/cargo-workspaces#publish)
Publish all the crates from the workspace in the correct order according to the dependencies. By default, this command runs version first. If you do not want that to happen, you can supply the --from-git option.
Also, you don't need to add --allow-branch main
because after some check, the help command say that the default branch is master
but an issue has been resolved to allow both master
and main
branch by default (it's has not been added in the documentation) : pksunkara/cargo-workspaces#32 (https://github.com/pksunkara/cargo-workspaces/blob/master/cargo-workspaces/src/utils/git.rs#L139)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all version as already been bumped through releaserc previous steps in a release process, I'm wondering if you need to pass --from-git argument avoiding execute cargo workspaces version before publish, accordingly to the documentation ? (https://github.com/pksunkara/cargo-workspaces#publish)
I saw this but the option --publish-as-is
is supposed to do this as well.
Also, you don't need to add --allow-branch main because after some check, the help command say that the default branch is master but an issue has been resolved to allow both master and main branch by default (it's has not been added in the documentation) : pksunkara/cargo-workspaces#32 (https://github.com/pksunkara/cargo-workspaces/blob/master/cargo-workspaces/src/utils/git.rs#L139)
Ah cool I didn't see this
0ab32cf
to
8e67725
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/publish.yml (1 hunks)
- Makefile.toml (2 hunks)
Additional comments not posted (3)
.github/workflows/publish.yml (2)
3-26
: Ensure conditional execution logic is correct for all jobs.All jobs are conditioned to run only when the
github.actor
isbot-anik
and the branch ismain
. Confirm that this is the intended behavior, as it restricts the workflow to a specific user and branch.Verification successful
Conditional execution logic is correctly implemented for all jobs.
The conditions restricting the workflow to run only when the
github.actor
isbot-anik
and the branch ismain
are correctly set for all jobs in the workflow file.
.github/workflows/publish.yml
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the conditional logic in the workflow file. # Test: Search for the conditional logic. Expect: Only occurrences with 'bot-anik' and 'main'. rg --type yaml -A 5 $'if: github.ref == \'refs/heads/main\' && github.actor == \'bot-anik\''Length of output: 101
Script:
#!/bin/bash # Description: Verify the conditional logic in the workflow file. # Check if the file exists if [ -f ".github/workflows/publish.yml" ]; then # Search for the conditional logic in the publish.yml file. rg --type yaml -A 5 "if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik'" .github/workflows/publish.yml else echo "File .github/workflows/publish.yml does not exist." fiLength of output: 688
41-44
: Review the environment variable and command for publishing crates.The environment variable
CARGO_REGISTRY_TOKEN
is correctly set for publishing. However, the commandcargo make publish-crates
should be verified to ensure it aligns with the new changes in theMakefile.toml
regarding smart-release and other publishing configurations.Verification successful
The command for publishing crates is correctly configured.
The command
cargo make publish-crates
used in the GitHub Actions workflow aligns with theMakefile.toml
configuration, which specifiescargo workspaces publish --publish-as-is
for thepublish-crates
task.
- The environment variable
CARGO_REGISTRY_TOKEN
is correctly set.- No additional configurations related to
smart-release
were found in theMakefile.toml
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the command used in the publishing step. # Test: Search for the command in the Makefile. Expect: Details on 'publish-crates'. rg --type toml -A 5 $'publish-crates' Makefile.tomlLength of output: 270
Script:
#!/bin/bash # Description: Verify if there are any configurations related to smart-release in Makefile.toml # Test: Search for 'smart-release' keyword in Makefile.toml rg --type toml 'smart-release' Makefile.toml # Test: Search for other relevant publishing configurations in Makefile.toml rg --type toml 'publish' Makefile.tomlLength of output: 158
Makefile.toml (1)
623-625
: Ensure the publishing task uses the correct command.The task uses
cargo workspaces publish --publish-as-is
. Verify that this command correctly handles the publication process as intended, especially considering the dependencies and order of crate publishing.
[tasks.update-workspace-dependency-versions] | ||
dependencies = ["install-toml-cli"] | ||
script = ''' | ||
next_version=$1 | ||
|
||
workspace_dependencies=( \ | ||
axone-cognitarium \ | ||
axone-rdf \ | ||
axone-wasm \ | ||
axone-cognitarium-client \ | ||
axone-logic-bindings \ | ||
axone-objectarium \ | ||
axone-objectarium-client \ | ||
) | ||
|
||
for workspace_dependency in ${workspace_dependencies[@]}; do | ||
toml set Cargo.toml workspace.dependencies.$workspace_dependency.version $next_version > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml | ||
done | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review the script for updating workspace dependency versions.
The script updates the versions of specified workspace dependencies in Cargo.toml
. Ensure that the command toml set
correctly modifies the file and that the temporary file handling is secure and error-proof.
- toml set Cargo.toml workspace.dependencies.$workspace_dependency.version $next_version > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml
+ toml set Cargo.toml workspace.dependencies.$workspace_dependency.version $next_version > Cargo.toml.tmp
+ if [ $? -eq 0 ]; then
+ mv Cargo.toml.tmp Cargo.toml
+ else
+ echo "Error updating workspace dependency versions"
+ rm Cargo.toml.tmp
+ exit 1
+ fi
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[tasks.update-workspace-dependency-versions] | |
dependencies = ["install-toml-cli"] | |
script = ''' | |
next_version=$1 | |
workspace_dependencies=( \ | |
axone-cognitarium \ | |
axone-rdf \ | |
axone-wasm \ | |
axone-cognitarium-client \ | |
axone-logic-bindings \ | |
axone-objectarium \ | |
axone-objectarium-client \ | |
) | |
for workspace_dependency in ${workspace_dependencies[@]}; do | |
toml set Cargo.toml workspace.dependencies.$workspace_dependency.version $next_version > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml | |
done | |
''' | |
[tasks.update-workspace-dependency-versions] | |
dependencies = ["install-toml-cli"] | |
script = ''' | |
next_version=$1 | |
workspace_dependencies=( \ | |
axone-cognitarium \ | |
axone-rdf \ | |
axone-wasm \ | |
axone-cognitarium-client \ | |
axone-logic-bindings \ | |
axone-objectarium \ | |
axone-objectarium-client \ | |
) | |
for workspace_dependency in ${workspace_dependencies[@]}; do | |
toml set Cargo.toml workspace.dependencies.$workspace_dependency.version $next_version > Cargo.toml.tmp | |
if [ $? -eq 0 ]; then | |
mv Cargo.toml.tmp Cargo.toml | |
else | |
echo "Error updating workspace dependency versions" | |
rm Cargo.toml.tmp | |
exit 1 | |
fi | |
done | |
''' |
Addresses the following Issue
Crates.io require that dependencies of a published crate be already published.
Error dependency not published
Smart-release fixes this by taking into consideration the interdependency of the crates. For the moment I've disabled changelog generation and github release but these are features that could be used if wanted.
I've taken the liberty of filling missing crate manifest fields useful for crate adoption. I leave it up to the team to decide if they're appropriate.
OBS
TODO:
Summary by CodeRabbit
New Features
Enhancements
Cargo.toml
files across multiple packages to include detailed metadata such as authors, homepage, license, documentation, and repository information.edition
to "2021" in relevantCargo.toml
files.Documentation
README.md
for theaxone-wasm
package to reflect new functionality of managing CosmWasm data.