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

Refactor: Load new template plugins and be compatible with old formats #136

Merged
merged 8 commits into from
Mar 26, 2024

Conversation

aooohan
Copy link
Member

@aooohan aooohan commented Mar 22, 2024

fix #110

@aooohan aooohan marked this pull request as ready for review March 25, 2024 04:33
@aooohan aooohan requested a review from bytemain March 25, 2024 04:35
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 44.76190% with 58 lines in your changes are missing coverage. Please review.

Project coverage is 36.02%. Comparing base (44443bf) to head (4817308).

Files Patch % Lines
internal/plugin.go 51.64% 31 Missing and 13 partials ⚠️
internal/manager.go 0.00% 11 Missing ⚠️
internal/luai/vm.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
- Coverage   36.10%   36.02%   -0.08%     
==========================================
  Files          25       25              
  Lines        2382     2451      +69     
==========================================
+ Hits          860      883      +23     
- Misses       1436     1480      +44     
- Partials       86       88       +2     

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

@bytemain
Copy link
Member

so in the new plugin system, is nodejs/npmmirror and nodejs/nodejs are maintained in a repo but will release two plugins?

internal/interfaces.go Outdated Show resolved Hide resolved
@bytemain
Copy link
Member

golang didn't provide a handy assert library, we can use https://pkg.go.dev/github.com/stretchr/testify to simplify the unittest in future

@aooohan
Copy link
Member Author

aooohan commented Mar 25, 2024

so in the new plugin system, is nodejs/npmmirror and nodejs/nodejs are maintained in a repo

Yes.

but will release two plugins?

No. It will still be one.

This is just a part of the new plugin system. After finishing this refactor, we will only maintain one plugin vfox-nodjs, which will include all mirrors (We can call them presets), user can use vfox swtich nodejs <preset-name> to switch the mirror they want to use, vfox will use default preset if user doesn't switch.

preset will be a new plugin capability that can be used for many things in the future, for now, it is used as a mirror switch.

Steps for commands after refactoring:

vfox add nodejs # fetch from https://github.com/version-fox/vfox-plugins

vfox swtich nodejs npmmirror # Switch to npmmirror

vfox switch nodejs default # switch to nodejs.org.

vfox swtich nodejs tinsghuamirror 

Feel free to expand, environment variables can also be supported, depending on what the plugin does.

@bytemain
Copy link
Member

bytemain commented Mar 25, 2024

The test coverage dropped by 0.2 percentage points and it failed to pass. This problem can be solved by configuring a codecov.yml

coverage:
  status:
    project:
      default:
        target: auto
        # allow coverage to drop by this amount and still post success
        threshold: 0.5%
        if_ci_failed: error
    patch: off # no github status notice for coverage of the PR diff.

put a codecov.yml in the root.

@aooohan aooohan requested a review from bytemain March 25, 2024 07:37
@aooohan aooohan merged commit 9a4e77e into main Mar 26, 2024
4 checks passed
@aooohan aooohan deleted the refactor/plugin_add branch March 26, 2024 03:03
aooohan added a commit that referenced this pull request Mar 26, 2024
# This is the 1st commit message:

fix: manifest url

# This is the commit message #2:

doc(readme): add roadmap

# This is the commit message #3:

doc(readme): add roadmap

# This is the commit message #4:

feat: support loong64 arch

fix #142

# This is the commit message #5:

ci: add coverage and codecov (#138)

* ci: add coverage and codecov

* ci: fix testcases

* ci: test all cases

* ci: fix testcase on ubuntu

* ci: add macos and windows

* ci: show err

* ci: update ci

* ci: fix testcase

* ci: cancel previous run

* ci: skip case on windows

* ci: update workflow
# This is the commit message #6:

fetch plugin from registry

# This is the commit message #7:

remove author field

# This is the commit message #8:

Load the corresponding hook when calling

# This is the commit message #9:

revert

# This is the commit message #10:

chore: smplified code

fix: unmarshal should based on type of golang (#137)

* fix: unmarshal should based on type of golang

* fix: encoding map[int] will cause error

* chore: update comment

* test: update testcase

* test: update testcase

* Update internal/luai/example_test.go

* test: fix testcases

* test: fix testcases

---------

Co-authored-by: Han Li <lihan@apache.org>

mod

fix: separate processing of PATH, ensuring order and de-duplication.

fix #144 #74

fix: test

Refactor: Load new template plugins and be compatible with old formats (#136)

* Refactoring plugin loading mechanism, support for both old and new templates

* fix: manifest url

* remove author field

* Load the corresponding hook when calling

* revert

* mod

add plugin from registry

bugfix

udpate plugin from registry

udpate plugin from registry

bugfix
aooohan added a commit that referenced this pull request Mar 26, 2024
# This is the 1st commit message:

fix: manifest url

# This is the commit message #2:

doc(readme): add roadmap

# This is the commit message #3:

doc(readme): add roadmap

# This is the commit message #4:

feat: support loong64 arch

fix #142

# This is the commit message #5:

ci: add coverage and codecov (#138)

* ci: add coverage and codecov

* ci: fix testcases

* ci: test all cases

* ci: fix testcase on ubuntu

* ci: add macos and windows

* ci: show err

* ci: update ci

* ci: fix testcase

* ci: cancel previous run

* ci: skip case on windows

* ci: update workflow
# This is the commit message #6:

fetch plugin from registry

# This is the commit message #7:

remove author field

# This is the commit message #8:

Load the corresponding hook when calling

# This is the commit message #9:

revert

# This is the commit message #10:

chore: smplified code

fix: unmarshal should based on type of golang (#137)

* fix: unmarshal should based on type of golang

* fix: encoding map[int] will cause error

* chore: update comment

* test: update testcase

* test: update testcase

* Update internal/luai/example_test.go

* test: fix testcases

* test: fix testcases

---------

Co-authored-by: Han Li <lihan@apache.org>

mod

fix: separate processing of PATH, ensuring order and de-duplication.

fix #144 #74

fix: test

Refactor: Load new template plugins and be compatible with old formats (#136)

* Refactoring plugin loading mechanism, support for both old and new templates

* fix: manifest url

* remove author field

* Load the corresponding hook when calling

* revert

* mod

add plugin from registry

bugfix

udpate plugin from registry

udpate plugin from registry

bugfix
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.

[Feature]: Load plug-ins implemented according to the template.
2 participants