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

reimplement functions in go-mouff-update, use ghreposervice #5470

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

novahow
Copy link
Contributor

@novahow novahow commented Jun 11, 2024

Tracking issue

closes #5372

Why are the changes needed?

flytectl upgrade is not working after monorepo integration

What changes were proposed in this pull request?

Cloned the code from the original external package https://github.com/mouuff/go-rocket-update/blob/v1.5.4/pkg/provider/provider_github.go , and made modifications to fit our needs

How was this patch tested?

make test_unit

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 21.97802% with 71 lines in your changes missing coverage. Please review.

Project coverage is 60.93%. Comparing base (5b0d787) to head (da3a344).
Report is 116 commits behind head on master.

Files with missing lines Patch % Lines
flytectl/pkg/github/provider.go 20.22% 68 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5470      +/-   ##
==========================================
- Coverage   60.97%   60.93%   -0.05%     
==========================================
  Files         794      796       +2     
  Lines       51488    51640     +152     
==========================================
+ Hits        31397    31465      +68     
- Misses      17199    17270      +71     
- Partials     2892     2905      +13     
Flag Coverage Δ
unittests-datacatalog 69.31% <ø> (ø)
unittests-flyteadmin 58.69% <ø> (ø)
unittests-flytecopilot 17.79% <ø> (ø)
unittests-flytectl 67.41% <21.97%> (-0.63%) ⬇️
unittests-flyteidl 79.04% <ø> (ø)
unittests-flyteplugins 61.85% <ø> (ø)
unittests-flytepropeller 57.29% <ø> (ø)
unittests-flytestdlib 65.59% <ø> (ø)

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.

@eapolinario
Copy link
Contributor

Thanks for your PR. Can you fix the lint errors?

Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

Do we really have to provide real implementations of all these functions in provider.go?

Also, can you add a few unit tests?

Comment on lines 18 to 20
// type GitHubProvider struct {
// provider.Github
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

remove.

Signed-off-by: novahow <[email protected]>
@novahow
Copy link
Contributor Author

novahow commented Jun 19, 2024

Do we really have to provide real implementations of all these functions in provider.go?

Also, can you add a few unit tests?

Currently I haven't came up with a way to better utilize the original provider, since embedding the original provider didn't seem feasible

Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests.

It's looking good. Just a few comments.

flytectl/cmd/upgrade/upgrade.go Outdated Show resolved Hide resolved
flytectl/cmd/upgrade/upgrade.go Outdated Show resolved Hide resolved
Signed-off-by: novahow <[email protected]>
Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

Thank you for this change. We're getting there.

Can you re-enable upgrade_test.go tests by removing this TestMain?

Also, in order to fix the version subcommand we have to make a slight change to how we pipe the latest flytectl version in flytectl makefile. Change GIT_VERSION to GIT_VERSION := $(shell git describe --dirty --tags --long --match flytectl/* --first-parent | sed 's/^flytectl\///')

novahow and others added 4 commits June 28, 2024 12:19
Signed-off-by: novahow <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
@eapolinario
Copy link
Contributor

Some tests in version_test.go were not calling TearDown (basically another instance of #5325). Fixed in da3a344.

Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

Thank you for all your work on this!

@eapolinario eapolinario enabled auto-merge (squash) July 2, 2024 00:25
@eapolinario eapolinario merged commit c512571 into flyteorg:master Jul 2, 2024
50 of 53 checks passed
vlibov pushed a commit to vlibov/flyte that referenced this pull request Aug 16, 2024
…#5470)

* reimplement functions in go-mouff-update, use ghreposervice

Signed-off-by: novahow <[email protected]>

* add tests

Signed-off-by: novahow <[email protected]>

* fix version error

Signed-off-by: novahow <[email protected]>

* remove testmain

Signed-off-by: novahow <[email protected]>

* Run make lint-fix

Signed-off-by: Eduardo Apolinario <[email protected]>

* Call TearDown

Signed-off-by: Eduardo Apolinario <[email protected]>

---------

Signed-off-by: novahow <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Vladyslav Libov <[email protected]>
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.

[BUG] flytectl upgrade is broken after moving to the monorepo
2 participants