-
Notifications
You must be signed in to change notification settings - Fork 28
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(scm): add new native scm driver #542
Conversation
Codecov Report
@@ 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
|
Why "native"? |
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. |
@@ -0,0 +1,164 @@ | |||
// Copyright (c) 2021 Target Brands, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update the copyright statement to use the current year? 👍
I think this change will need to be applied throughout the files being added here.
|
||
// OrgAccess captures the user's access level for an org. | ||
func (c *client) OrgAccess(u *library.User, org string) (string, error) { | ||
logrus.Tracef("Capturing %s access level to org %s", u.GetName(), org) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update the logging statements to reflect current state in the codebase? 👍
i.e.
Lines 16 to 21 in 3fe3d7e
// OrgAccess captures the user's access level for an org. | |
func (c *client) OrgAccess(u *library.User, org string) (string, error) { | |
c.Logger.WithFields(logrus.Fields{ | |
"org": org, | |
"user": u.GetName(), | |
}).Tracef("capturing %s access level to org %s", u.GetName(), org) |
I think this change will need to be applied throughout the functions and files being added here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by "current state" in this context? Could you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By current state, I mean what we currently have in the SCM codebase on the master
branch 👍
That link I shared above should show what I'm talking about 😃
To clarify further with an example, I'd expect this line to be updated to:
logrus.Tracef("Capturing %s access level to org %s", u.GetName(), org) | |
c.Logger.WithFields(logrus.Fields{ | |
"org": org, | |
"user": u.GetName(), | |
}).Tracef("capturing %s access level to org %s", u.GetName(), org) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, I'm sorry I see it now. You mean using the client logger. Sorry, for some reason my eyes weren't picking up the difference. Yeah, super easy change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to apologize 😄 It's all good!
Hopefully you should be able to copy/paste almost all the logging statements from the current SCM code 👍
However, it may be tedious because there are a lot of them 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to get it out of the way now tho. So good call out!
@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! |
PR includes the following changes:
closes go-vela/community#441
Notes: