Skip to content

Commit b7d4959

Browse files
Add sample workflow, fix conflicts
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
2 parents d9012c1 + 4366d27 commit b7d4959

26 files changed

+190
-12
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @getsaurabh02 @peterzhuamazon
1+
* @getsaurabh02 @peterzhuamazon @gaiksaya @prudhvigodithi

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
- name: Install dependencies and build the code
2121
run: npm install
2222
- name: Verify styling
23+
id: style_verify
2324
run: npm run format-dryrun
25+
- name: Verify styling failure msg
26+
if: steps.style_verify.outcome == 'failure'
27+
run: echo "Please run 'npm run format' before commiting the code!"
2428
- name: Run build
2529
run: npm run build

MAINTAINERS.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
88

99
## Current Maintainers
1010

11-
| Maintainer | GitHub ID | Affiliation |
12-
| ------------ | --------------------------------------------------- | ----------- |
13-
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
14-
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
11+
| Maintainer | GitHub ID | Affiliation |
12+
| --------------- | --------------------------------------------------- | ----------- |
13+
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
14+
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
15+
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
16+
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |
1517

1618
## Emeritus
1719

jest.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ module.exports = {
66
'^.+\\.tsx?$': 'ts-jest',
77
},
88
};
9-

src/app.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Probot } from 'probot';
210
import { Service } from './service/service';
311

src/call/create-issue-comment.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
// Name : createIssueComment
210
// Description : create an issue comment as the app
311
// Arguments :

src/call/github-merged-pulls-monitor.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
// Name : githubMergedPullsMonitor
210
// Description : Monitors the CI workflows of merged pull requests, providing metrics that give an overview of whether pull requests were merged without passing CI checks.
311

src/call/github-workflow-runs-monitor.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
// Name : githubWorkflowRunsMonitor
210
// Description : prints the githubWorkflowRunsMonitor output and indexes logData to OpenSearch
311
// Arguments :

src/call/print-to-console.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
// Name : printToConsole
210
// Description : print a message to the console
311
// Arguments :

src/config/config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import Ajv from 'ajv';
210
import addFormats from 'ajv-formats';
311
import { load, YAMLException } from 'js-yaml';

src/config/operation-config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Operation } from '../service/operation/operation';
210
import { Task } from '../service/operation/task';
311
import { OperationData, TaskData } from './types';

src/config/types.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
// Resource
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
29
export interface ResourceData {
310
organizations: OrganizationData[];
411
}

src/service/operation/operation.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Task } from './task';
210

311
export class Operation {

src/service/operation/task.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import randomstring from 'randomstring';
210
import { TaskArgData } from '../../config/types';
311

src/service/resource/entity.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210

311
export abstract class Entity {

src/service/resource/issue.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210
import { Entity } from './entity';
311

src/service/resource/organization.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210
import { Entity } from './entity';
311
import { Project } from './project';

src/service/resource/project-field.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210
import { Entity } from './entity';
311

src/service/resource/project.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210
import { Entity } from './entity';
311
import { ProjectField } from './project-field';

src/service/resource/repository.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { ProbotOctokit } from 'probot';
210
import { Entity } from './entity';
311

src/service/resource/resource.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Organization } from './organization';
210

311
export class Resource {

src/service/service.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Probot } from 'probot';
210
import type { WebhookEventMap } from '@octokit/webhooks-types';
311
import { access, realpath } from 'fs/promises';

src/utility/octokit.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { Probot, ProbotOctokit } from 'probot';
210

311
export async function octokitAuth(app: Probot, installationId: number): Promise<ProbotOctokit> {

src/utility/opensearchclient.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { STSClient, AssumeRoleCommand } from '@aws-sdk/client-sts';
210
import { ApiResponse, Client as OpenSearchClient } from '@opensearch-project/opensearch';
311
import { AwsSigv4Signer } from '@opensearch-project/opensearch/lib/aws/index';

test/index.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
/* eslint-disable */
210
// @ts-nocheck
311

test/utility/opensearchclient.test.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
19
import { STSClient, AssumeRoleCommand } from '@aws-sdk/client-sts';
210
import { Client as OpenSearchClient } from '@opensearch-project/opensearch';
311
import { OpensearchClient } from '../../src/utility/opensearchclient'; // Adjust import path as needed
@@ -29,7 +37,7 @@ describe('OpensearchClient', () => {
2937
delete process.env.REGION;
3038
delete process.env.OPENSEARCH_URL;
3139
});
32-
40+
3341
beforeEach(() => {
3442
(STSClient as jest.Mock).mockImplementation(() => ({
3543
send: jest.fn().mockResolvedValue({
@@ -60,9 +68,7 @@ describe('OpensearchClient', () => {
6068

6169
const opensearchClient = new OpensearchClient();
6270

63-
await expect(opensearchClient.getClient()).rejects.toThrow(
64-
'Failed to assume role: credentials are undefined.'
65-
);
71+
await expect(opensearchClient.getClient()).rejects.toThrow('Failed to assume role: credentials are undefined.');
6672
});
6773
});
6874

@@ -98,7 +104,7 @@ describe('OpensearchClient', () => {
98104
const index = 'test-index';
99105

100106
await expect(opensearchClient.bulkIndex(index, documents)).rejects.toThrow(
101-
'Bulk indexing errors: [{"type":"some_error","reason":"Some error occurred"}]'
107+
'Bulk indexing errors: [{"type":"some_error","reason":"Some error occurred"}]',
102108
);
103109
});
104110
});

0 commit comments

Comments
 (0)