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

feat: add diff and home command in confix #14568

Merged
merged 15 commits into from
Jan 16, 2023
Merged

feat: add diff and home command in confix #14568

merged 15 commits into from
Jan 16, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Jan 10, 2023

Description

Follow-up of #14342.
Ref: #13661, #11051


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
  • 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)

@github-actions github-actions bot added the C:Confix Issues and PR related to Confix label Jan 10, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jan 10, 2023

[Cosmos SDK - Confix] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

samricotta
samricotta approved these changes Jan 10, 2023
Copy link
Contributor

@samricotta samricotta left a comment

Choose a reason for hiding this comment

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

Instructions look good, accidentally approved

@julienrbrt julienrbrt self-assigned this Jan 16, 2023

// LoadConfig loads and parses the TOML document from path.
func LoadConfig(path string) (*tomledit.Document, error) {
f, err := os.Open(path)

Check failure

Code scanning / gosec

Potential file inclusion via variable

Potential file inclusion via variable
if err != nil {
return nil, fmt.Errorf("failed to open %q: %v", path, err)
}
defer f.Close()

Check failure

Code scanning / gosec

Deferring unsafe method "Close" on type "*os.File"

Deferring unsafe method "Close" on type "*os.File"
tools/confix/cmd/diff.go Fixed Show fixed Hide fixed
tools/confix/cmd/diff.go Fixed Show fixed Hide fixed
@julienrbrt julienrbrt changed the title feat: add diff command in confix and improve migrate feat: add diff and home command in confix Jan 16, 2023
@julienrbrt julienrbrt marked this pull request as ready for review January 16, 2023 12:00
@julienrbrt julienrbrt requested a review from a team as a code owner January 16, 2023 12:00

```go
rootCmd.AddCommand(
confixcmd.ConfigCommand(),
Copy link
Member

Choose a reason for hiding this comment

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

if a users adds custom values to the app.toml how will the command know to add them when a migration happens? or does it generate a new config and compare

Copy link
Member Author

@julienrbrt julienrbrt Jan 16, 2023

Choose a reason for hiding this comment

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

Right now, it still only compares to the SDK default against a file, but in #14630 I'll improve the non standalone functionalities. This is a good use case, as I was thinking of only SDK defaults, but comparing app default is probably better. Adding to the issue.

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

left one question but otherwise lgtm

@github-actions github-actions bot added the C:Cosmovisor Issues and PR related to Cosmovisor label Jan 16, 2023
@julienrbrt julienrbrt enabled auto-merge (squash) January 16, 2023 13:05
@julienrbrt julienrbrt merged commit e88a084 into main Jan 16, 2023
@julienrbrt julienrbrt deleted the julien/config-fix-2 branch January 16, 2023 13:27
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants