Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add [gitlablicense] services #8024
Add [gitlablicense] services #8024
Changes from all commits
eed8032
fd13db8
4d8c367
f31f5cc
7cb571e
bb0c8a1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The
renderLicenseBadge
helper actually handles cases when there's no license provided:shields/services/licenses.js
Lines 121 to 123 in fd13db8
and the benefit of utilizing that is both simplicity in code and also consistency across our badges.
Did you structure this with different behavior deliberately or was it just simply a case of not knowing the helper handled that, and if it's the former, would you mind explaining your thought process?
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.
I refer to the Github licence for this part.
shields/services/github/github-license.service.js
Lines 29 to 37 in dc06b44
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.
Interesting, thanks for sharing. I'd be curious to know what other maintainers think, if there's more backstory on why GitHub is handled this way. Given the goals of the project I'd be hesitant to introduce this another case of inconsistent behavior in the no license scenario, unless there's good reason
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.
I don't think we necessarily have to remove this test (in part because I realize it bears similarity to the corresponding github tests), but did want to note that it's not necessary for purposes of service/integration tests.
The license renderer is already extensively tested so we're typically content not trying to retest that logic in service tests
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.
Yep, I wrote this test more to show the data structure of
licence
, so that the developer can understand what fields are in the structure directly through this test case, without having to actually call it.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.
Understood, and again don't feel like you need to change anything, but my point is that we don't really do that especially not with our service tests. The schema we define in the service class that is used for validating response objects from the upstream APIs is how we typically "document" the structure and relevant fields, along with trying to include links to the upstream documentation.
Compared to other types of tests our service tests are slow and expensive and we typically use them to provide validation against the upstream services we integrate with/to catch when vendors/platforms make breaking changes to their APIs. They can be used to test/do other things, it's just that we typically try to refrain from doing so because of the associated drawbacks.
This is just an fyi/food for thought in case you decide you'd like to work on other badges in the future, GitLab or otherwise