Skip to content

Commit

Permalink
Add sample workflow, fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
  • Loading branch information
prudhvigodithi committed Sep 26, 2024
2 parents d9012c1 + 4366d27 commit 79e91a5
Show file tree
Hide file tree
Showing 25 changed files with 190 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @getsaurabh02 @peterzhuamazon
* @getsaurabh02 @peterzhuamazon @gaiksaya @prudhvigodithi
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
- name: Install dependencies and build the code
run: npm install
- name: Verify styling
id: style_verify
run: npm run format-dryrun
- name: Verify styling failure msg
if: steps.style_verify.outcome == 'failure'
run: echo "Please run 'npm run format' before commiting the code!"
- name: Run build
run: npm run build
14 changes: 8 additions & 6 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ This document contains a list of maintainers in this repo. See [opensearch-proje

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| ------------ | --------------------------------------------------- | ----------- |
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
| Maintainer | GitHub ID | Affiliation |
| ------------------ | --------------------------------------------------------- | ----------- |
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |

## Emeritus

| Maintainer | GitHub ID | Affiliation |
| ---------- | --------- | ----------- |
| Maintainer | GitHub ID | Affiliation |
| ------------------ | --------------------------------------------------------- | ----------- |
8 changes: 8 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Probot } from 'probot';
import { Service } from './service/service';

Expand Down
8 changes: 8 additions & 0 deletions src/call/create-issue-comment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

// Name : createIssueComment
// Description : create an issue comment as the app
// Arguments :
Expand Down
8 changes: 8 additions & 0 deletions src/call/github-merged-pulls-monitor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

// Name : githubMergedPullsMonitor
// 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.

Expand Down
8 changes: 8 additions & 0 deletions src/call/github-workflow-runs-monitor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

// Name : githubWorkflowRunsMonitor
// Description : prints the githubWorkflowRunsMonitor output and indexes logData to OpenSearch
// Arguments :
Expand Down
8 changes: 8 additions & 0 deletions src/call/print-to-console.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

// Name : printToConsole
// Description : print a message to the console
// Arguments :
Expand Down
8 changes: 8 additions & 0 deletions src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import { load, YAMLException } from 'js-yaml';
Expand Down
8 changes: 8 additions & 0 deletions src/config/operation-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Operation } from '../service/operation/operation';
import { Task } from '../service/operation/task';
import { OperationData, TaskData } from './types';
Expand Down
9 changes: 8 additions & 1 deletion src/config/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Resource
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

export interface ResourceData {
organizations: OrganizationData[];
}
Expand Down
8 changes: 8 additions & 0 deletions src/service/operation/operation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Task } from './task';

export class Operation {
Expand Down
8 changes: 8 additions & 0 deletions src/service/operation/task.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import randomstring from 'randomstring';
import { TaskArgData } from '../../config/types';

Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/entity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';

export abstract class Entity {
Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/issue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';
import { Entity } from './entity';

Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/organization.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';
import { Entity } from './entity';
import { Project } from './project';
Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/project-field.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';
import { Entity } from './entity';

Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/project.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';
import { Entity } from './entity';
import { ProjectField } from './project-field';
Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/repository.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { ProbotOctokit } from 'probot';
import { Entity } from './entity';

Expand Down
8 changes: 8 additions & 0 deletions src/service/resource/resource.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Organization } from './organization';

export class Resource {
Expand Down
8 changes: 8 additions & 0 deletions src/service/service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Probot } from 'probot';
import type { WebhookEventMap } from '@octokit/webhooks-types';
import { access, realpath } from 'fs/promises';
Expand Down
8 changes: 8 additions & 0 deletions src/utility/octokit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { Probot, ProbotOctokit } from 'probot';

export async function octokitAuth(app: Probot, installationId: number): Promise<ProbotOctokit> {
Expand Down
8 changes: 8 additions & 0 deletions src/utility/opensearchclient.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { STSClient, AssumeRoleCommand } from '@aws-sdk/client-sts';
import { ApiResponse, Client as OpenSearchClient } from '@opensearch-project/opensearch';
import { AwsSigv4Signer } from '@opensearch-project/opensearch/lib/aws/index';
Expand Down
8 changes: 8 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/* eslint-disable */
// @ts-nocheck

Expand Down
10 changes: 9 additions & 1 deletion test/utility/opensearchclient.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

import { STSClient, AssumeRoleCommand } from '@aws-sdk/client-sts';
import { Client as OpenSearchClient } from '@opensearch-project/opensearch';
import { OpensearchClient } from '../../src/utility/opensearchclient'; // Adjust import path as needed
Expand Down Expand Up @@ -29,7 +37,7 @@ describe('OpensearchClient', () => {
delete process.env.REGION;
delete process.env.OPENSEARCH_URL;
});

beforeEach(() => {
(STSClient as jest.Mock).mockImplementation(() => ({
send: jest.fn().mockResolvedValue({
Expand Down

0 comments on commit 79e91a5

Please sign in to comment.