diff --git a/dev/release-v6.ts b/dev/release-v6.ts index d8cfe4ca8d23..dda5fd792e7b 100755 --- a/dev/release-v6.ts +++ b/dev/release-v6.ts @@ -35,16 +35,23 @@ const RELEASING_COLUMN_ID = 17444349; process.exit(1); } - const github = new Octokit({ - auth: token - }); + const github = new Octokit({ auth: token }); const commits = await getCommitsFromProject(github); - await Promise.all(commits.map(commit => mergeCommit(github, commit))); + await processCommitsInSeries(github, commits); })(); // Helpers +async function processCommitsInSeries(github: Octokit, commits: CardCommit[]) { + let commit: CardCommit | undefined = commits.shift(); + + while (commit) { + await mergeCommit(github, commit); + commit = commits.shift(); + } +} + async function getCommitsFromProject(github: Octokit): Promise { const cards = await github.rest.projects.listCards({ column_id: TO_BE_RELEASED_COLUMN_ID @@ -110,15 +117,19 @@ function mergeCommitTeaser(commit: PullRequest) { } async function moveCard(github: Octokit, card: Card, to: number) { + let result = 'skipped'; + if (process.env.DRY_RUN === 'false') { - const a = await github.rest.projects.moveCard({ + const response = await github.rest.projects.moveCard({ card_id: card.id, position: 'bottom', column_id: to }); - console.log(a); + result = response.status === 201 ? 'success' : 'error'; } + + console.info('- Card moved to column:', result); } async function gitMerge(sha: string) { diff --git a/test/unit/model/find-by-pk.test.js b/test/unit/model/find-by-pk.test.js index fc25f56119e1..d87dfa0399e7 100644 --- a/test/unit/model/find-by-pk.test.js +++ b/test/unit/model/find-by-pk.test.js @@ -5,9 +5,11 @@ const chai = require('chai'); const expect = chai.expect; const Support = require('../support'); +const Sequelize = Support.Sequelize; +const Op = Sequelize.Op; const current = Support.sequelize; const sinon = require('sinon'); -const { DataTypes, Sequelize } = require('@sequelize/core'); +const DataTypes = require('../../../lib/data-types'); describe(Support.getTestDialectTeaser('Model'), () => { describe('method findByPk', () => {