-
Notifications
You must be signed in to change notification settings - Fork 30
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 GitLab integration #1116
Merged
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
88a5619
Add Gtilab functionalities
alessandrozago 8672ba9
Fix new gitlab files using eslint
alessandrozago 5dbe093
Add tests for GitLab class and format fixes
alessandrozago b67e361
Remove existing GitLab repository in the config
alessandrozago 46567ed
Add EUPL-1.2 copyright
alessandrozago 3a64bf0
Use only a single template for README
alessandrozago d46c68c
Fix release zip upload not working
alessandrozago e423dd3
Update changelog
alessandrozago 61b20a6
Merge branch 'main' into main
alessandrozago 3b964ca
Fix typo on changelog
alessandrozago 07aac6f
Remove explicit EUPL-1.2 copyright in files
alessandrozago bbf5e58
Align logging messages format with latest releases
alessandrozago 00a3076
Merge branch 'main' into main
alessandrozago bb72636
Merge branch 'main' into main
alessandrozago 3b92517
Factorize code between Gitlab and GitHub reporters
Ndpnt 48ad093
Factorize code between Gitlab and GitHub publisher
Ndpnt ca58f97
Fix deprecated method
Ndpnt a6d8d29
Improve changelog
Ndpnt 64d1060
Improve changelog entry
Ndpnt 8769d0f
Add release funders
Ndpnt aed17f3
Clarify token precedence between GitHub and GitLab
Ndpnt cd411eb
Update changelog entry
Ndpnt c9fa05e
Add backward compatibility for legacy config
Ndpnt 4496f52
Use proper configuration key
Ndpnt 24875eb
Improve test maintainability
Ndpnt 0bdd637
Improve comment
Ndpnt 356a8b8
Implement no-op clearCache in GitLab reporter
Ndpnt 2dda758
Remove obsolete log
Ndpnt 7df61b6
Improve wording
Ndpnt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { expect } from 'chai'; | ||
|
||
import Reporter from './index.js'; | ||
|
||
describe('Reporter', () => { | ||
describe('#normalizeConfig', () => { | ||
context('with current config format', () => { | ||
it('returns the config as is', () => { | ||
const config = { repositories: { declarations: 'owner/repo' } }; | ||
const normalizedConfig = Reporter.normalizeConfig(config); | ||
|
||
expect(normalizedConfig).to.deep.equal(config); | ||
}); | ||
}); | ||
|
||
context('with old config format where githubIssues is nested under reporter', () => { | ||
it('returns a normalized config', () => { | ||
const config = { githubIssues: { repositories: { declarations: 'owner/repo' } } }; | ||
const expectedConfig = { | ||
type: 'github', | ||
repositories: { declarations: 'owner/repo' }, | ||
}; | ||
const normalizedConfig = Reporter.normalizeConfig(config); | ||
|
||
expect(normalizedConfig).to.deep.equal(expectedConfig); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('#validateConfiguration', () => { | ||
context('with valid configuration', () => { | ||
it('does not throw an error', () => { | ||
const repositories = { declarations: 'owner/repo' }; | ||
|
||
expect(() => { | ||
Reporter.validateConfiguration(repositories); | ||
}).not.to.throw(); | ||
}); | ||
}); | ||
|
||
context('with invalid configuration', () => { | ||
context('when declarations key is missing', () => { | ||
it('throws an error', () => { | ||
const repositories = {}; | ||
|
||
expect(() => { | ||
Reporter.validateConfiguration(repositories); | ||
}).to.throw('Required configuration key "reporter.repositories.declarations" was not found; issues on the declarations repository cannot be created'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}); | ||
}); | ||
|
||
context('when repository format is incorrect', () => { | ||
it('throws an error', () => { | ||
const repositories = { declarations: 'invalidFormat' }; | ||
|
||
expect(() => { | ||
Reporter.validateConfiguration(repositories); | ||
}).to.throw('Configuration entry "reporter.repositories.declarations" is expected to be a string in the format <owner>/<repo>, but received: "invalidFormat"'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
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.
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.