Skip to content

Commit

Permalink
fix: don't call overloaded versions of find functions internally (seq…
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepold authored and maramizo committed Jun 2, 2022
1 parent 80030a3 commit 9ccd1ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 17 additions & 6 deletions dev/release-v6.ts
Expand Up @@ -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<CardCommit[]> {
const cards = await github.rest.projects.listCards({
column_id: TO_BE_RELEASED_COLUMN_ID
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion test/unit/model/find-by-pk.test.js
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 9ccd1ee

Please sign in to comment.