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: force flags with -- #1051

Merged
merged 2 commits into from
Nov 16, 2023
Merged

feat: force flags with -- #1051

merged 2 commits into from
Nov 16, 2023

Conversation

mrostamii
Copy link
Contributor

Description

We addressed an issue where the bridge flag was ignored when we used it like bridge --all. So, in this PR, we ensure all flags must start with --.

Changes

Added a statement on RunE to check if all of the used flags to run the app are started with --FLAG.

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Nodes audience

No need to modify any nodes and service file. It just prevents the app from starting with a wrong flag that would be ignored.

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply

Cross repository changes

  • This PR requires changes to bor
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai
  • I have created new e2e tests into express-cli

Manual tests

Head to the repository path, then run the app:

go run ./cmd/heimdalld/main.go start --home "$HOME/heimdall" bridge --all --chain=mainnet --rest-server

The response is:

ERROR:  invalid argument: bridge 
        all flags must start with --
exit status 1

- to don't ignore all of the flags without --
- one problem is with the `bridge` flag so it simply was ignored
@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

see 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@VAIBHAVJINDAL3012
Copy link
Contributor

Hi @mrostamii
Changes seems good to me , but for an extra confirmation I will run this on the local devnet and approve this PR by this weekend.

Copy link

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Nov 11, 2023
@marcello33 marcello33 requested a review from a team November 16, 2023 08:44
@marcello33
Copy link
Contributor

Thanks @mrostamii, we'll be merging this!

@marcello33 marcello33 merged commit 3fab40d into maticnetwork:develop Nov 16, 2023
8 of 9 checks passed
Raneet10 pushed a commit that referenced this pull request Feb 13, 2024
- to don't ignore all of the flags without --
- one problem is with the `bridge` flag so it simply was ignored
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.

None yet

4 participants