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

staging contract CLI #1393

Merged
merged 80 commits into from
Feb 17, 2024
Merged

staging contract CLI #1393

merged 80 commits into from
Feb 17, 2024

Conversation

ianthpun
Copy link
Contributor

@ianthpun ianthpun commented Feb 8, 2024

Closes #1387 #1386 #1397 #1398 #1399

Description

create function commands for
getStagedCode
isStaged
listStagedContracts
StageContract
UnstageContract

include unit tests for each to test working behavior


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2024

Codecov Report

Attention: 54 lines in your changes are missing coverage. Please review.

Comparison is base (752eb7b) 40.60% compared to head (becb0d2) 41.87%.
Report is 1 commits behind head on feature/stable-cadence.

Files Patch % Lines
internal/migrate/migrate.go 60.00% 10 Missing and 8 partials ⚠️
internal/migrate/stage_contract.go 64.28% 5 Missing and 5 partials ⚠️
internal/migrate/get_staged_code.go 68.42% 3 Missing and 3 partials ⚠️
internal/migrate/is_staged.go 68.42% 3 Missing and 3 partials ⚠️
internal/migrate/unstage_contract.go 68.42% 3 Missing and 3 partials ⚠️
internal/migrate/list_staged_contracts.go 75.00% 2 Missing and 2 partials ⚠️
internal/transactions/transactions.go 0.00% 3 Missing ⚠️
internal/scripts/scripts.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/stable-cadence    #1393      +/-   ##
==========================================================
+ Coverage                   40.60%   41.87%   +1.27%     
==========================================================
  Files                          47       53       +6     
  Lines                        2596     2746     +150     
==========================================================
+ Hits                         1054     1150      +96     
- Misses                       1417     1447      +30     
- Partials                      125      149      +24     
Flag Coverage Δ
unittests 41.87% <64.00%> (+1.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ianthpun
Copy link
Contributor Author

works for me, i'll get those moved over and have you take a look at it. Originally we considered having it there in the first place but due to time i just had it in the CLI. But i can get something out for it by EOD

@bjartek
Copy link
Collaborator

bjartek commented Feb 16, 2024

I am heading afk for a week. So if you are on the clock just leave it.

@ianthpun
Copy link
Contributor Author

@bthaile @bjartek I've created onflow/flowkit#13 which would move those methods over there. Let me know what you think, if it looks good i can merge, release, and have this package use it

@ianthpun ianthpun changed the base branch from master to feature/stable-cadence February 16, 2024 19:00
Copy link
Contributor

@sisyphusSmiling sisyphusSmiling left a comment

Choose a reason for hiding this comment

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

Testing commands against Testnet LGTM, great work!

@ianthpun ianthpun dismissed bjartek’s stale review February 16, 2024 23:04

fixed bjarteks issues, but he is gone for the week. The helper funcs are addressed inside flowkit/v2 but currently have dependency issues, will come back to this after

Copy link
Contributor

@jribbink jribbink left a comment

Choose a reason for hiding this comment

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

Looks great! Have some nits mostly arround improving some of the test coverage.

internal/migrate/get_staged_code_test.go Show resolved Hide resolved
internal/migrate/get_staged_code_test.go Show resolved Hide resolved
internal/migrate/unstage_contract_test.go Show resolved Hide resolved
internal/migrate/get_staged_code_test.go Show resolved Hide resolved
}, nil)

srv.ExecuteScript.Run(func(args mock.Arguments) {
script := args.Get(1).(flowkit.Script)
Copy link
Contributor

Choose a reason for hiding this comment

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

imo we should be asserting that ExecuteScript was called with the correct CDC script

internal/migrate/is_staged_test.go Show resolved Hide resolved
internal/migrate/list_staged_contracts_test.go Outdated Show resolved Hide resolved
internal/migrate/stage_contract_test.go Show resolved Hide resolved
internal/migrate/stage_contract_test.go Show resolved Hide resolved
internal/util/test.go Outdated Show resolved Hide resolved
@ianthpun ianthpun merged commit d09e68f into feature/stable-cadence Feb 17, 2024
5 checks passed
@ianthpun ianthpun deleted the ianthpun/stage-contract branch February 17, 2024 00:56
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.

Stage contracts through flow CLI
6 participants