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

fix: prevent nil lastcommitid hash #18563

Merged
merged 8 commits into from
Nov 28, 2023
Merged

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Nov 27, 2023

Description

this pr is an alternative to #18524 that prevents nil apphash in store instead of higher up.

This pr is against release/0.50.x instead of main since store/v1 does not exist in main any longer


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Copy link
Contributor

coderabbitai bot commented Nov 27, 2023

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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

@tac0turtle tac0turtle changed the base branch from main to release/v0.50.x November 27, 2023 10:46
@tac0turtle tac0turtle marked this pull request as ready for review November 27, 2023 10:49
@tac0turtle tac0turtle requested a review from a team as a code owner November 27, 2023 10:49

This comment has been minimized.

@julienrbrt
Copy link
Member

julienrbrt commented Nov 27, 2023

This pr is against release/0.50.x instead of main since store/v1 does not exist in main any longer

Right, but we still need a follow-up in main as well for the baseapp changes.

Can we get a store changelog entry? (not sure if we require a sdk one as the behavior will be the same). Store tests are failing as well with this new behavior.

About the replace, can we get a comment next to the go.mod import, so we don't forget before tagging v0.50.1 that store needs to be tagged before.

@tac0turtle
Copy link
Member Author

This pr is against release/0.50.x instead of main since store/v1 does not exist in main any longer

Right, but we still need a follow-up in main as well for the baseapp changes.

Can we get a store changelog entry? (not sure if we require a sdk one as the behavior will be the same). Store tests are failing as well with this new behavior.

About the replace, can we get a comment next to the go.mod import, so we don't forget before tagging v0.50.1 that store needs to be tagged before.

ill tag 1.1 after this merge then remove go.mod and update it on main

Copy link
Member

@facundomedica facundomedica left a comment

Choose a reason for hiding this comment

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

lgtm, I like this solution more 👌

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Makes sense, maybe we should double check people don't have custom logic doing a CommitID().Hash == nil somewhere in their code base.

@facundomedica
Copy link
Member

Makes sense, maybe we should double check people don't have custom logic doing a CommitID().Hash == nil somewhere in their code base.

There's the IsZero() method they can use to replace that if needed and I'd hope they have been using that already

return types.CommitInfo{StoreInfos: storeInfos}.Hash()
apphash := types.CommitInfo{StoreInfos: storeInfos}.Hash()

if len(apphash) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

this checking also would be unnecessary

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto -- unnecessary

store/CHANGELOG.md Outdated Show resolved Hide resolved
store/CHANGELOG.md Show resolved Hide resolved
return types.CommitInfo{StoreInfos: storeInfos}.Hash()
apphash := types.CommitInfo{StoreInfos: storeInfos}.Hash()

if len(apphash) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto -- unnecessary

@tac0turtle tac0turtle merged commit 20337d9 into release/v0.50.x Nov 28, 2023
47 of 49 checks passed
@tac0turtle tac0turtle deleted the marko/nil_apphash branch November 28, 2023 14:27
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants