server
server copied to clipboard
feat(scm): add new native scm driver
PR includes the following changes:
- add a Bitbucket option for using the native driver
- add a native driver implentation based on the jenkins-x/go-scm library
closes https://github.com/go-vela/community/issues/441
Notes:
- The SCM package has been functionally tested with a set of pipelines against GitHub and Bitbucket.
- I will not be adding docs yet because I do not recommend using the package until further testing is completed
- The new library has a lot of testing downsides I would like to re-think in next pr. (Documented with TODOs)
Codecov Report
Merging #542 (0b7c390) into master (74b5d14) will decrease coverage by
1.47%
. The diff coverage is34.66%
.
@@ Coverage Diff @@
## master #542 +/- ##
==========================================
- Coverage 54.85% 53.38% -1.48%
==========================================
Files 179 188 +9
Lines 14899 16073 +1174
==========================================
+ Hits 8173 8580 +407
- Misses 6409 7149 +740
- Partials 317 344 +27
Impacted Files | Coverage Δ | |
---|---|---|
scm/native/changeset.go | 0.00% <0.00%> (ø) |
|
scm/native/webhook.go | 0.00% <0.00%> (ø) |
|
scm/native/access.go | 22.42% <22.42%> (ø) |
|
scm/native/repo.go | 23.79% <23.79%> (ø) |
|
scm/native/deployment.go | 38.75% <38.75%> (ø) |
|
scm/setup.go | 79.22% <42.85%> (-20.78%) |
:arrow_down: |
scm/native/authentication.go | 67.12% <67.12%> (ø) |
|
scm/native/opts.go | 88.67% <88.67%> (ø) |
|
scm/native/native.go | 95.91% <95.91%> (ø) |
|
scm/native/driver.go | 100.00% <100.00%> (ø) |
Why "native"? Other possibilities: "generic", "abstract", "shim"
I was originally thinking generic for the package name but we actually already use the native nomenclature in a few package interfaces. The thought was native might sync up with that thought better and do like the standard OAuth esque integrations and then other packages could focus on being more 1st class citizens to the individual SCMs if we want that.
Definitely not stuck on the name by any means, I'm largely indifferent on what we call it. I just thought in the moment it made sense when I was first structuring out the package/files.
@kneal looks like this has gone stale, so we're going to close for now, but are interested in adding more SCM providers. Please reopen if we want to move forward with it!