Skip to content

Commit

Permalink
Improve wording and add license-hearder-checker
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored and prudhvigodithi committed Sep 26, 2024
1 parent b7d4959 commit 9c9aa84
Show file tree
Hide file tree
Showing 33 changed files with 346 additions and 120 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright OpenSearch Contributors
* 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.
*/

module.exports = {
env: {
browser: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: build app
name: build-test

on: [push, pull_request]

Expand Down Expand Up @@ -27,3 +27,5 @@ jobs:
run: echo "Please run 'npm run format' before commiting the code!"
- name: Run build
run: npm run build
- name: Run Test
run: npm test
12 changes: 12 additions & 0 deletions .github/workflows/license-header-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: License Header Checker

on: [push, pull_request]

jobs:
license-header-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add License Header
run: npx @kt3k/license-checker
33 changes: 33 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"**/*.*": [" Copyright OpenSearch Contributors", " SPDX-License-Identifier: Apache-2.0"],
"ignore": [
".prettierrc",
".md",
".flake8",
".yml",
".yaml",
".bat",
".json",
".txt",
".config",
".swp",
"tests/tests_test_workflow/test_integ_workflow/integ_test/data/artifacts/",
"tests/tests_sign_workflow/data/signature/",
"tests/tests_assemble_workflow/data/artifacts/",
".png",
"settings.gradle",
".git",
".lychee.excludes",
".whitesource",
".shellcheckrc",
".lock",
".gradle",
".cert",
".key",
".jar",
".gz",
".toml",
".ini",
"gradle/wrapper"
]
}
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje

| Maintainer | GitHub ID | Affiliation |
| --------------- | --------------------------------------------------- | ----------- |
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
| Saurabh Singh | [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 |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The automation app utilizes the [Probot](https://probot.github.io/) framework an

### Service

A **Service** is an instance of the app that manages and manipulates specific `Resource` while performing defined `Operation`.
A `Service` is an instance of the app that manages and manipulates specific `Resource` while performing defined `Operation`.

- **Resource**: Objects or entities the service will manage or modify, such as GitHub organizations, project, repositories, issues, etc.
- **Operation**: A list of `Tasks` triggered by events with the resources.
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'], // Points to 'test' directory where your test files live
testMatch: ['**/*.test.ts'], // Match test files ending with `.test.ts`
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
Expand Down
3 changes: 2 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/call/create-issue-comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
5 changes: 3 additions & 2 deletions src/call/github-merged-pulls-monitor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand All @@ -10,7 +11,7 @@
// 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.

import { Probot } from 'probot';
import { OpensearchClient } from '../utility/opensearchclient';
import { OpensearchClient } from '../utility/opensearch/opensearch-client';

export default async function githubMergedPullsMonitor(app: Probot, context: any): Promise<void> {
const pr = context.payload.pull_request;
Expand Down
11 changes: 6 additions & 5 deletions src/call/github-workflow-runs-monitor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand All @@ -9,16 +10,16 @@
// Name : githubWorkflowRunsMonitor
// Description : prints the githubWorkflowRunsMonitor output and indexes logData to OpenSearch
// Arguments :
// - events : The list of events to monitor and index, from https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows.
// - events : The list of events to monitor and index, from https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows.

import { Probot } from 'probot';
import { OpensearchClient } from '../utility/opensearchclient';
import { OpensearchClient } from '../utility/opensearch/opensearch-client';

interface WorkflowRunEvents {
interface WorkflowRunMonitorArgs {
events: string[];
}

export default async function githubWorkflowRunsMonitor(app: Probot, context: any, { events }: WorkflowRunEvents): Promise<void> {
export default async function githubWorkflowRunsMonitor(app: Probot, context: any, { events }: WorkflowRunMonitorArgs): Promise<void> {
const job = context.payload.workflow_run;

if (!events.includes(job?.event)) {
Expand Down
3 changes: 2 additions & 1 deletion src/call/print-to-console.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/config/operation-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
9 changes: 9 additions & 0 deletions src/config/resource-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright OpenSearch Contributors
* 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 { ResourceData, OrganizationData } from './types';
import { Resource } from '../service/resource/resource';
Expand Down
5 changes: 3 additions & 2 deletions src/config/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down Expand Up @@ -44,5 +45,5 @@ export interface TaskData {
}

export interface TaskArgData {
[key: string]: string;
[key: string]: string | string[];
}
3 changes: 2 additions & 1 deletion src/service/operation/operation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/operation/task.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/issue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/organization.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/project-field.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/service/resource/resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
5 changes: 3 additions & 2 deletions src/service/service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand All @@ -14,7 +15,7 @@ import { Operation } from './operation/operation';
import { Task } from './operation/task';
import { ResourceConfig } from '../config/resource-config';
import { OperationConfig } from '../config/operation-config';
import { octokitAuth } from '../utility/octokit';
import { octokitAuth } from '../utility/probot/octokit';

export class Service {
private name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
3 changes: 2 additions & 1 deletion src/utility/octokit.ts → src/utility/probot/octokit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
Expand Down
Loading

0 comments on commit 9c9aa84

Please sign in to comment.