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

unified all tests into a concluding test #2

Closed
wants to merge 9 commits into from

Conversation

Bullrich
Copy link

@Bullrich Bullrich commented Feb 19, 2024

  • Does not require a CHANGELOG entry

Summary by CodeRabbit

  • New Features

    • Added a job to confirm all migrations passed in the CI/CD pipeline.
    • Introduced a job to ensure all tests passed successfully in the CI/CD workflow.
  • Documentation

    • Updated the CHANGELOG with details on the deprecation of the xcm::body::TREASURER_INDEX constant.
  • Refactor

    • Updated numeric values in integration tests for more accurate testing.
    • Renamed and modified a test function for setting XCM versions in integration tests.
    • Deprecated a constant in favor of a more standard variant for future use.
    • Reorganized imports and adjusted constants for currency and XCM bodies in configuration files.
    • Modified method chaining in a build script for enhanced feature export.
    • Updated imports and constants related to runtime in XCM configuration.

Bullrich and others added 9 commits February 19, 2024 16:46
Test was singular, it should be plural
The matrix jobs are already depended by other jobs. We can simply remove their dependency
It looks a bit better than simply adding a print line statement
Let's unify everything at once
Added a shorter name to make it easier to understand
@cla-bot-2021-stg
Copy link

User @muharem, please sign the CLA here.

Copy link

coderabbitai bot commented Feb 22, 2024

Warning

Rate Limit Exceeded

@Bullrich has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 44 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 959b830 and cb2f032.

Walkthrough

The recent updates introduce enhancements and deprecations in the workflow and codebase, focusing on migration and test verification, XCM version handling, and constant deprecation in favor of updated variants. These changes streamline CI processes, refine integration tests, and update constants for better code clarity and future compatibility.

Changes

File Path Change Summary
.github/workflows/check-migrations.yml
.github/workflows/test.yml
Added jobs confirmMigrationsPassed and confirmTestPassed to confirm migrations and tests passed, respectively.
CHANGELOG.md
relay/polkadot/constants/src/lib.rs
system-parachains/collectives/.../src/xcm_config.rs
Deprecated xcm::body::TREASURER_INDEX, replaced by xcm::BodyId::Treasury.
integration-tests/emulated/.../src/tests/send.rs Updated a numeric value in send_xcm_from_para_to_system_para_paying_fee_with_assets_works.
integration-tests/emulated/.../src/tests/set_xcm_versions.rs Renamed and modified system_para_sets_relay_xcm_supported_version to system_para_sersion.
relay/polkadot/src/xcm_config.rs Reorganized imports and adjusted constants for FellowshipAdminBodyId and TreasurerBodyId.
system-parachains/collectives/.../build.rs Changed method call from export_heap_base() to with_curree().

🐇✨
In the code's vast, verdant field,
Changes bloom, old constants yield.
Migrations checked, tests confirmed,
Towards cleaner code, our compass turned.
Through the warren, swift we hop,
With every commit, improvements non-stop.
🌟🐾

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 66519d7 and a815839.
Files selected for processing (9)
  • .github/workflows/check-migrations.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs (1 hunks)
  • integration-tests/emulated/assets/asset-hub-kusama/src/tests/set_xcm_versions.rs (1 hunks)
  • relay/polkadot/constants/src/lib.rs (1 hunks)
  • relay/polkadot/src/xcm_config.rs (2 hunks)
  • system-parachains/collectives/collectives-polkadot/build.rs (1 hunks)
  • system-parachains/collectives/collectives-polkadot/src/xcm_config.rs (2 hunks)
Additional comments: 9
integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs (1)
  • 87-87: The update to the numeric value in the test seems to reflect an adjustment in expected weights or fees. Ensure this change aligns with the latest expectations for the test's functionality.
.github/workflows/check-migrations.yml (1)
  • 115-121: The addition of the confirmMigrationsPassed job to the workflow is correctly implemented and aligns with the PR's objectives to enhance the project's CI/CD pipeline by ensuring migrations conclusively pass before proceeding.
relay/polkadot/constants/src/lib.rs (1)
  • 112-113: The deprecation of the TREASURER_INDEX constant is correctly implemented, with a clear message guiding developers towards using xcm::latest::BodyId::Treasury instead. This change aligns with the project's objectives to standardize constants within the XCM configurations.
.github/workflows/test.yml (1)
  • 208-217: The addition of the confirmTestPassed job to the workflow is correctly implemented and aligns with the PR's objectives to enhance the project's CI/CD pipeline by ensuring tests conclusively pass before proceeding.
CHANGELOG.md (1)
  • 22-22: The documentation of the deprecation and replacement of the xcm::body::TREASURER_INDEX constant in the CHANGELOG.md is clear and follows the standard changelog format. Including the link to the pull request is a good practice for traceability.
relay/polkadot/src/xcm_config.rs (2)
  • 32-32: The reorganization of imports and the adjustment of constants for FellowshipAdminBodyId and TreasurerBodyId are correctly implemented. It's important to ensure that these changes are reflected wherever these constants are used throughout the project to maintain consistency.
Verification successful

The constants FellowshipAdminBodyId and TreasurerBodyId appear to be used consistently throughout the project, as indicated by their presence in multiple files across different directories. This suggests that the changes have been correctly implemented and propagated. However, given the complexity and specificity of their usage contexts, it's recommended to manually review these instances to ensure their correctness and consistency fully.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the updated constants are correctly used throughout the project.
rg --type rust 'FellowshipAdminBodyId|TreasurerBodyId'

Length of output: 2245

* 239-239: The update to use `BodyId::Treasury` for `TreasurerBodyId` aligns with the PR's objective to standardize and update constants related to XCM configurations. Ensure that this change is consistently applied across all relevant parts of the codebase.
Verification successful

The usage of TreasurerBodyId as BodyId::Treasury across the project appears consistent and aligns with the objective to standardize and update constants related to XCM configurations. The constant is defined and used in a manner that suggests a coherent application across different parts of the codebase, including both definitions and functional contexts. Based on the provided evidence, the update seems to have been consistently applied across all relevant parts of the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Confirm the consistent use of TreasurerBodyId across the project.
rg --type rust 'TreasurerBodyId'

Length of output: 1115

system-parachains/collectives/collectives-polkadot/src/xcm_config.rs (2)
  • 33-33: The removal of the xcm_constants import and the subsequent change to use BodyId::Treasury directly is a positive change towards standardizing constants within the project's XCM configurations. This aligns with the PR's objective of updating deprecated elements to align with newer standards or requirements. However, ensure that all references to the deprecated xcm::body::TREASURER_INDEX constant elsewhere in the codebase have been updated accordingly to prevent any unresolved references or compilation errors.
Verification successful

The search for references to the deprecated constant xcm::body::TREASURER_INDEX did not yield any results, indicating that it has likely been successfully removed or replaced throughout the codebase. This supports the initial assessment that the changes align with the project's goal of updating and standardizing constants within the XCM configurations. However, it's recommended to conduct a comprehensive review of the entire codebase to ensure all necessary updates have been made and to verify the integration and functionality of these changes in the broader context.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any remaining references to the deprecated constant.
rg --type rust 'xcm::body::TREASURER_INDEX'

Length of output: 43

* 61-61: The update to `TreasurerBodyId` to use `BodyId::Treasury` directly is a clear and straightforward change that improves the clarity and maintainability of the code by relying on the more descriptive and standardized `BodyId::Treasury` variant. This change is consistent with the PR's objectives and does not introduce any apparent issues. However, it's important to verify that this change is reflected wherever `TreasurerBodyId` is utilized to ensure consistency across the codebase.
Verification successful

The search results indicate that the update to TreasurerBodyId to use BodyId::Treasury is consistently applied across the codebase, with references found in multiple files within both the system-parachains/collectives/collectives-polkadot and relay/polkadot directories. This suggests that the change is correctly reflected wherever TreasurerBodyId is utilized, aligning with the PR's objectives for clarity and maintainability.

However, given the nature of code review and the limitations of not being able to inspect the exact context of each usage, it's recommended to perform a manual review to ensure that the change aligns with the intended functionality in all cases and that there are no hidden issues.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any usage of `TreasurerBodyId` to ensure consistency.
rg --type rust 'TreasurerBodyId'

Length of output: 1115

@@ -16,8 +16,7 @@
#[cfg(feature = "std")]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.with_curree()
Copy link

Choose a reason for hiding this comment

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

The method with_curree() seems to be incorrect or a typo. Please verify the intended functionality. If you meant to use a method from the substrate_wasm_builder crate to configure the Wasm build process, it's possible that the correct method name might be different.

<AssetHubKusama as Chain>::RuntimeCall::PolkadotXcm(pallet_xcm::Call::<
<AssetHubKusama as Chain>::Runtime,
>::force_xcm_version {
fn system_para_sersion {
Copy link

Choose a reason for hiding this comment

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

The function name system_para_sersion seems to be a typo. Consider renaming it to system_para_version or a more descriptive name that accurately reflects the test's purpose.

@Bullrich Bullrich force-pushed the bullrich/unify-jobs branch from a815839 to cb2f032 Compare February 22, 2024 16:02
@Bullrich Bullrich closed this Feb 22, 2024
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.

1 participant