Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
extends: '@loopback/eslint-config',
ignorePatterns: ['commitlint.config.js', 'src/release_notes/**/*.js'],
rules: {
'no-extra-boolean-cast': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# environment: production # Uncomment if you set an environment name in npm trusted publisher settings

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch-depth is necessary to get all tags
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@0.28.0
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
scan-type: "fs"
scan-ref: "${{ github.workspace }}"
trivy-config: "${{ github.workspace }}/trivy.yaml"
scan-type: 'fs'
scan-ref: '${{ github.workspace }}'
trivy-config: '${{ github.workspace }}/trivy.yaml'
6,158 changes: 2,834 additions & 3,324 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 29 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,49 +67,50 @@
],
"peerDependencies": {
"@loopback/core": "^7.0.3",
"@sourceloop/core": "^20.0.0"
"@sourceloop/core": "^20.0.6"
},
"dependencies": {
"@aws-sdk/client-eventbridge": "^3.816.0",
"@aws-sdk/client-sqs": "^3.658.1",
"@loopback/rest": "^15.0.4",
"@loopback/rest-explorer": "^8.0.4",
"bullmq": "^5.13.2",
"@aws-sdk/client-eventbridge": "^3.1027.0",
"@aws-sdk/client-sqs": "^3.1027.0",
"@loopback/rest": "^15.0.11",
"@loopback/rest-explorer": "^8.0.11",
"bullmq": "^5.73.2",
"crypto-js": "^4.2.0",
"ioredis": "^5.3.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@eslint/js": "^9.20.0",
"@loopback/build": "^12.0.3",
"@loopback/core": "^7.0.3",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@eslint/js": "^9.39.4",
"@loopback/build": "^12.0.10",
"@loopback/core": "^7.0.10",
"@loopback/eslint-config": "^16.0.1",
"@semantic-release/changelog": "^6.0.1",
"@loopback/testlab": "^8.0.10",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^12.0.0",
"@semantic-release/npm": "^13.1.1",
"@semantic-release/github": "^12.0.6",
"@semantic-release/npm": "^13.1.5",
"@semantic-release/release-notes-generator": "^10.0.3",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@semantic-release/release-notes-generator - update missing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll update this in follow-up PR since it is a major version change.

"@loopback/testlab": "^8.0.3",
"@types/jest": "^29.5.5",
"@types/node": "^18.11.9",
"@types/jest": "^29.5.14",
"@types/node": "^18.19.130",
"@types/proxyquire": "^1.3.31",
"commitizen": "^4.2.4",
"commitizen": "^4.3.1",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0",
"cz-customizable": "^6.9.2",
"cz-customizable-ghooks": "^2.0.0",
"eslint": "^8.57.1",
"git-release-notes": "^5.0.0",
"globals": "^15.15.0",
"husky": "^7.0.4",
"jsdom": "^21.0.0",
"jsdom": "^21.1.2",
"proxyquire": "^2.1.3",
"semantic-release": "^25.0.1",
"simple-git": "^3.15.1",
"semantic-release": "^25.0.3",
"simple-git": "^3.35.2",
"source-map-support": "^0.5.21",
"typescript": "~5.2.2",
"typescript-eslint": "^8.24.0"
"typescript-eslint": "^8.58.1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand All @@ -118,7 +119,11 @@
"git-release-notes": {
"ejs": "^3.1.8",
"yargs": "^17.6.2"
}
},
"form-data": "^2.5.4",
"lodash": "^4.18.0",
"underscore": "^1.13.8",
"undici": "^6.24.0"
},
"config": {
"commitizen": {
Expand Down
24 changes: 15 additions & 9 deletions src/__tests__/acceptance/bullmq/bullmq.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,24 @@ function runBullMqConnectorTests(
let producerService: TestProducerService;
let listenerStub: sinon.SinonStub;

before(async function () {
if (!condition()) this.skip();
producerApp = await setupProducerApplication(queue);
producerService = producerApp.getSync<TestProducerService>(
`services.TestProducerService`,
);
listenerStub = sinon.stub().resolves();
queue.register(listenerStub);
/* eslint-disable @typescript-eslint/no-invalid-this */
before(function () {
if (!condition()) {
this.skip();
}
return setupProducerApplication(queue).then(app => {
producerApp = app;
producerService = producerApp.getSync<TestProducerService>(
`services.TestProducerService`,
);
listenerStub = sinon.stub().resolves();
queue.register(listenerStub);
});
});
/* eslint-enable @typescript-eslint/no-invalid-this */

beforeEach(() => listenerStub.reset());
after(async () => await producerApp?.stop());
after(async () => producerApp?.stop());

runProducerTests(
() => listenerStub,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ interface MockBullMQConsumerService {
processMessage: sinon.SinonStub;
}

let mockBullMQConsumerService: MockBullMQConsumerService;

describe('EventHandlerService', () => {
let consumerApp: ConsumerApp;
let consumerStub: sinon.SinonStub;
Expand Down
19 changes: 15 additions & 4 deletions src/release_notes/post-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const https = require('node:https');
const jsdom = require('jsdom');
module.exports = async function (data, callback) {
const rewritten = [];
const issuePromises = [];

for (const commit of data.commits) {
if (commit.title.indexOf('chore(release)') !== -1) {
continue;
Expand All @@ -20,11 +22,19 @@ module.exports = async function (data, callback) {
: null;
});

const issueDesc = await getIssueDesc(commit.issueno).then(res => {
return res;
});
commit.issueTitle = issueDesc;
// Collect all promises
issuePromises.push(
getIssueDesc(commit.issueno).then(issueDesc => {
commit.issueTitle = issueDesc;
return commit;
}),
);
}

// Wait for all promises to resolve
const commitsWithIssues = await Promise.all(issuePromises);

for (const commit of commitsWithIssues) {
commit.committerDate = new Date(commit.committerDate).toLocaleDateString(
'en-us',
{
Expand All @@ -35,6 +45,7 @@ module.exports = async function (data, callback) {
);
rewritten.push(commit);
}

callback({
commits: rewritten.filter(Boolean),
range: data.range,
Expand Down
5 changes: 4 additions & 1 deletion src/strategies/bullmq/services/bullmq-consumer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export class BullMQConsumerService {
clearInterval(interval);
return;
}
void this.autoScaler();
// Explicitly ignore the promise as we're firing and forgetting
this.autoScaler().catch(err => {
this.logger.error('AutoScaler error:', err);
});
}, this.queuePollInterval);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {Producer} from '../../../types';
@injectable({
scope: BindingScope.TRANSIENT,
})
export class EventBridgeProducerService<Stream extends AnyObject = AnyObject>
implements Producer<Stream>
{
export class EventBridgeProducerService<
Stream extends AnyObject = AnyObject,
> implements Producer<Stream> {
private source: string = DEFAULT_SOURCE;
private eventBusName: string;

Expand Down
4 changes: 2 additions & 2 deletions src/strategies/sqs/keys.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {BindingKey} from '@loopback/core';
import {Config as SQSConfig} from './types';
import {producerKeyForQueue} from '../../utils';
import {Producer, QueueType} from '../../types';
import {Producer as ProducerType, QueueType} from '../../types';
import {SQSClient} from '@aws-sdk/client-sqs';
import {EventStreamConnectorNamespace} from '../../keys';

Expand All @@ -14,7 +14,7 @@ export namespace SQSBindings {
`${EventStreamConnectorNamespace}.sqs.client`,
);

export const Producer = BindingKey.create<Producer>(
export const Producer = BindingKey.create<ProducerType>(
producerKeyForQueue(QueueType.SQS),
);
export const SQSConsumerProvider = BindingKey.create<void>(
Expand Down
Loading