Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhvigodithi committed Oct 1, 2024
2 parents 6227aa0 + c4d6e3f commit a8e7a12
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@ jobs:
run: npm run build
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload junit test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/check-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Check Version Bump

on:
pull_request:

jobs:
check-version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: 'echo "No version change! Please bump the version in package.json!" && exit 1'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log
!mock-cert.pem
.env*
coverage
junit.xml
bin
temp/*

Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
reporters: ['default', 'jest-junit'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
Expand Down
45 changes: 44 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch-automation-app",
"version": "0.1.0",
"version": "0.1.2",
"description": "An Automation App that handles all your GitHub Repository Activities",
"author": "Peter Zhu",
"homepage": "https://github.com/opensearch-project/automation-app",
Expand All @@ -22,7 +22,7 @@
"format": "prettier --write src/**/*.ts test/**/*.ts configs/**/*.yml",
"format-dryrun": "prettier --check src/**/*.ts test/**/*.ts configs/**/*.yml",
"lint": "eslint --fix \"src/**/*.ts\" --ignore-pattern \"**/*.d.ts\"",
"test": "jest --coverage"
"test": "jest --coverage --reporters=jest-junit"
},
"dependencies": {
"@aws-sdk/client-opensearch": "^3.658.1",
Expand Down Expand Up @@ -54,6 +54,7 @@
"eslint-plugin-import": "^2.30.0",
"globals": "^15.9.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"nock": "^14.0.0-beta.5",
"prettier": "^3.3.3",
"smee-client": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/call/github-merged-pulls-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default async function githubMergedPullsMonitor(app: Probot, context: any
const [month, year] = [new Date().getMonth() + 1, new Date().getFullYear()].map((num) => String(num).padStart(2, '0'));

try {
await new OpensearchClient().bulkIndex(`github-pulls-ci-runs-checks-${month}-${year}`, logDataArray);
await new OpensearchClient().bulkIndex(`github-pulls-ci-workflow-runs-${month}-${year}`, logDataArray);
app.log.info('All log data indexed successfully.');
} catch (error) {
app.log.error(`Error indexing log data: ${error}`);
Expand Down
2 changes: 1 addition & 1 deletion test/call/github-merged-pulls-monitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('githubMergedPullsMonitor', () => {
ref: 'abcdef123456',
});
expect(mockBulkIndex).toHaveBeenCalledWith(
expect.stringMatching(/^github-pulls-ci-runs-checks-\d{2}-\d{4}$/),
expect.stringMatching(/^github-pulls-ci-workflow-runs-\d{2}-\d{4}$/),
expect.arrayContaining([
expect.objectContaining({
number: 123,
Expand Down

0 comments on commit a8e7a12

Please sign in to comment.