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

🎨 Faire un bump de version mineure par défaut #221

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions run/services/slack/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ function _isReleaseTypeInvalid(releaseType) {
}
async function publishAndDeployPixUI(repoName, releaseType, responseUrl) {
if (_isReleaseTypeInvalid(releaseType)) {
slackPostMessageService.postMessage(
'Erreur lors du choix de la nouvelle version de Pix UI. Veuillez indiquer "major", "minor" ou "patch".'
);
throw new Error(
'Erreur lors du choix de la nouvelle version de Pix UI. Veuillez indiquer "major", "minor" ou "patch".'
);
releaseType = 'minor';
}
const releaseTagBeforeRelease = await githubServices.getLatestReleaseTag(repoName);
await releasesService.publishPixRepo(repoName, releaseType);
Expand All @@ -85,12 +80,7 @@ async function publishAndDeployPixUI(repoName, releaseType, responseUrl) {

async function publishAndDeployEmberTestingLibrary(repoName, releaseType, responseUrl) {
if (_isReleaseTypeInvalid(releaseType)) {
slackPostMessageService.postMessage(
'Erreur lors du choix de la nouvelle version d\'ember-testing-library. Veuillez indiquer "major", "minor" ou "patch".'
);
throw new Error(
'Erreur lors du choix de la nouvelle version d\'ember-testing-library. Veuillez indiquer "major", "minor" ou "patch".'
);
releaseType = 'minor';
}
const releaseTagBeforeRelease = await githubServices.getLatestReleaseTag(repoName);
await releasesService.publishPixRepo(repoName, releaseType);
Expand Down
12 changes: 6 additions & 6 deletions test/unit/run/services/slack/commands_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ describe('Services | Slack | Commands', () => {
sinon.assert.calledWith(githubServices.getLatestReleaseTag, 'pix-ui');
});

it('should stop release if no version is given', async () => {
it('should create a minor version if no version is given', async () => {
// given
const payload = { text: '' };

// when
const response = await catchErr(createAndDeployPixUI)(payload);
await createAndDeployPixUI(payload);

// then
expect(response).to.be.instanceOf(Error);
sinon.assert.calledWith(releasesServices.publishPixRepo, 'pix-ui', 'minor');
});
});

Expand All @@ -143,15 +143,15 @@ describe('Services | Slack | Commands', () => {
sinon.assert.calledWith(githubServices.getLatestReleaseTag, 'ember-testing-library');
});

it('should stop release if no version is given', async () => {
it('should create a minor version if no version is given', async () => {
// given
const payload = { text: '' };

// when
const response = await catchErr(createAndDeployEmberTestingLibrary)(payload);
await createAndDeployEmberTestingLibrary(payload);

// then
expect(response).to.be.instanceOf(Error);
sinon.assert.calledWith(releasesServices.publishPixRepo, 'ember-testing-library', 'minor');
});
});

Expand Down