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

chore(dashmate): set tenderdash version to 1 #2385

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Dec 12, 2024

Issue being fixed or feature implemented

Tenderdash is updated to version 1

What was done?

  • Set tenderdash version to 1 to automatically update tenderdash without breaking changes

How Has This Been Tested?

None

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • New Features
    • Introduced a migration for configuration files to update the Docker image for the tenderdash component to version 1.
  • Bug Fixes
    • Updated the Docker image version reference in the configuration for the drive platform.

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Walkthrough

The changes involve updates to the Docker image version for the tenderdash component in two files: getBaseConfigFactory.js and getConfigFileMigrationsFactory.js. The Docker image version is modified from 'dashpay/tenderdash:1.3' to 'dashpay/tenderdash:1'. Additionally, a new migration function is introduced in the latter file to ensure that all configurations are updated to the new image version for version 1.7.0. No other logic or functionality changes were made.

Changes

File Path Change Summary
packages/dashmate/configs/defaults/getBaseConfigFactory.js Updated Docker image version for tenderdash from 'dashpay/tenderdash:1.3' to 'dashpay/tenderdash:1'.
packages/dashmate/configs/getConfigFileMigrationsFactory.js Added new migration function for version 1.7.0 to update Docker image for tenderdash to 'dashpay/tenderdash:1'.

Possibly related PRs

  • chore(dashmate): update Core to version 22 #2107: This PR updates the Docker image for the tenderdash component to dashpay/tenderdash:1 in the getConfigFileMigrationsFactory.js, which is directly related to the changes made in the main PR that also updates the Docker image version for tenderdash in getBaseConfigFactory.js.
  • chore(dashmate): do not call mint on masternodes #2172: Although this PR focuses on the mint command, it also involves configuration changes that may indirectly relate to the overall configuration management.
  • revert: upgrade to Core v22 #2354: This PR reverts changes related to the Core 22 upgrade, including modifications to the Docker image version for the dashd service, providing relevant context.

Suggested labels

dashmate

Suggested reviewers

  • QuantumExplorer
  • lklimek

🐇 In the land of code where changes bloom,
A tender dash image makes room.
From 1.3 to 1, it hops along,
With migrations in place, it can't go wrong.
So let’s cheer for updates, both big and small,
For in this code garden, we nurture them all! 🌼


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>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@shumkov shumkov self-assigned this Dec 12, 2024
@shumkov shumkov added this to the v1.7.0 milestone Dec 12, 2024
Copy link
Contributor

@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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9d4dc and e8dcdee.

📒 Files selected for processing (2)
  • packages/dashmate/configs/defaults/getBaseConfigFactory.js (1 hunks)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/dashmate/configs/defaults/getBaseConfigFactory.js

Comment on lines +1051 to +1057
'1.7.0': (configFile) => {
Object.entries(configFile.configs)
.forEach(([, options]) => {
options.platform.drive.tenderdash.docker.image = 'dashpay/tenderdash:1';
});
return configFile;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Migration introduces version regression from 1.3 to 1

The version history shows a concerning regression in tenderdash versions:

  • Version 1.1.1: Sets to 'dashpay/tenderdash:1.2.0'
  • Version 1.3.0: Updates to 'dashpay/tenderdash:1.3'
  • Version 1.4.0-dev.1: Maintains 'dashpay/tenderdash:1.3'
  • Version 1.7.0 (current): Downgrades to 'dashpay/tenderdash:1'

This migration appears to be downgrading the tenderdash version from 1.3 to 1, which is likely unintended and could cause compatibility issues. The version should either maintain 1.3 or upgrade to a newer version, but not downgrade.

🔗 Analysis chain

LGTM! Migration function correctly updates tenderdash version.

The migration function follows the established pattern and properly updates the tenderdash Docker image version to '1' across all configurations, which aligns with the PR objectives.

Let's verify that this is the only place where the tenderdash version needs to be updated:


Tenderdash version update requires additional changes

The migration function needs to be reviewed as there are inconsistencies in tenderdash versioning across the codebase:

  • packages/dashmate/configs/defaults/getBaseConfigFactory.js sets default image to 'dashpay/tenderdash:1'
  • Multiple migrations in getConfigFileMigrationsFactory.js show version changes:
    • From 0.13.2 (in test fixtures) to 1.2.0
    • Then to 1.3
    • And now attempting to change to 1

This suggests a potential regression as we're moving from version 1.3 to 1, which might not be intended. Let's verify the version history:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other occurrences of tenderdash version specifications
# Test: Search for tenderdash Docker image version declarations
rg "dashpay/tenderdash:[0-9]" --type js

Length of output: 1334


Script:

#!/bin/bash
# Get the chronological order of migrations to understand version progression
ast-grep --pattern 'options.platform.drive.tenderdash.docker.image = $_' packages/dashmate/configs/getConfigFileMigrationsFactory.js -A 5 -B 5

Length of output: 25532

@@ -310,7 +310,7 @@ export default function getBaseConfigFactory() {
tenderdash: {
mode: 'full',
docker: {
image: 'dashpay/tenderdash:1.3',
image: 'dashpay/tenderdash:1',
Copy link
Contributor

Choose a reason for hiding this comment

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

I still believe this should be 1.4. Using 1 can cause use of - for example - 1.0.0 (if it's already pulled) which is not compatible.

We had issues with drive where people didn't do dashmate update (or it failed?) and were reporting issues. Using more precise tag should fix this issue, and enforce update even if the user doesn't call dashmate update directly.

And it will protect against unintended minor version updates.

Copy link
Member Author

@shumkov shumkov Dec 12, 2024

Choose a reason for hiding this comment

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

We use the same approach for Core (only major version is specified).
Will you change your opinion if dashmate will automatically pull images after updating the package version?

Copy link
Contributor

Choose a reason for hiding this comment

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

This will definitely help, but will still not be perfect. The issue is that docker does not support semver :)

Accepting for now, but needs more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants