Skip to content

Commit

Permalink
Add copyright header to all files
Browse files Browse the repository at this point in the history
Signed-off-by: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com>
  • Loading branch information
yorinasub17 committed Sep 30, 2023
1 parent 12e637c commit f6dfce4
Show file tree
Hide file tree
Showing 48 changed files with 165 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/custom-environment-variables.json5
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1


{
configFileSizeLimit: {
__name: "FENSAK_CONFIG_FILE_SIZE_LIMIT",
Expand Down
4 changes: 4 additions & 0 deletions config/default.json5
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1


// NOTE
// Many of these are secrets, and thus are sourced from environment variables
// (see ./custom-environment-variables.json5).
Expand Down
3 changes: 3 additions & 0 deletions deployments/dev/app.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Fensak, LLC.
# SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

# Docker compose file for starting a dev environment of the full fensak application. Depends on db.docker-compose.yml to
# provide the database.
version: "3.9"
Expand Down
3 changes: 3 additions & 0 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export {
crypto,
toHashString,
Expand Down
3 changes: 3 additions & 0 deletions fskconfig/loader_github.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { base64, config, Octokit, path } from "../deps.ts";

import { compileRuleFn, RuleFnSourceLang } from "../udr/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions fskconfig/loader_github_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import {
assert,
assertEquals,
Expand Down
3 changes: 3 additions & 0 deletions fskconfig/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* fskconfig
* Contains the routines for parsing the Fensak Config. Supports loading from:
Expand Down
3 changes: 3 additions & 0 deletions fskconfig/parser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Ajv, path, toml, yaml } from "../deps.ts";

import { RuleFnSourceLang } from "../udr/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions fskconfig/parser_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { assertEquals, assertThrows, path } from "../test_deps.ts";
import { parseConfigFile } from "./parser.ts";
import { RuleFnSourceLang } from "../udr/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions ghauth/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { base64, config, Octokit, octokitCreateAppAuth } from "../deps.ts";

const privateKeyBytes = base64.decode(config.get("github.app.privateKey"));
Expand Down
3 changes: 3 additions & 0 deletions ghauth/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* ghauth
* Contains utilities and constants for authenticating to GitHub API and Webhooks.
Expand Down
3 changes: 3 additions & 0 deletions ghauth/rest_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { config, Octokit } from "../deps.ts";

const token = config.get("github.apiToken");
Expand Down
3 changes: 3 additions & 0 deletions ghauth/webhooks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { config, GitHubWebhooks } from "../deps.ts";

const secret = config.get("github.webhookSecret");
Expand Down
3 changes: 3 additions & 0 deletions ghevent/checks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Octokit } from "../deps.ts";

import { IRuleLogEntry } from "../udr/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions ghevent/handler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import {
GitHubInstallationEvent,
GitHubMarketplacePurchaseEvent,
Expand Down
3 changes: 3 additions & 0 deletions ghevent/installation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { config } from "../deps.ts";
import type { GitHubInstallationEvent } from "../deps.ts";

Expand Down
3 changes: 3 additions & 0 deletions ghevent/marketplace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { config } from "../deps.ts";
import type { GitHubMarketplacePurchaseEvent } from "../deps.ts";

Expand Down
3 changes: 3 additions & 0 deletions ghevent/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* ghevent
* Contains handlers for GitHub webhook events that can be loaded into the Webhooks object to process the events.
Expand Down
3 changes: 3 additions & 0 deletions ghevent/pullrequest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { config, Octokit } from "../deps.ts";
import type {
GitHubPullRequestEvent,
Expand Down
3 changes: 3 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { startWorker } from "./worker/mod.ts";
import { startWebServer } from "./web/mod.ts";

Expand Down
3 changes: 3 additions & 0 deletions middlewares/base.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Context, crypto, Status } from "../deps.ts";
import type { Middleware, Next } from "../deps.ts";

Expand Down
3 changes: 3 additions & 0 deletions middlewares/ghevent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Context, Status } from "../deps.ts";
import type { Middleware, Next } from "../deps.ts";
import { githubWebhooks } from "../ghauth/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions middlewares/ghevent_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import {
assertEquals,
assertNotEquals,
Expand Down
3 changes: 3 additions & 0 deletions middlewares/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* middlewares
* Contains middlewares used by the web server.
Expand Down
3 changes: 3 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export * from "./udr/mod.ts";
export * from "./patch/mod.ts";
3 changes: 3 additions & 0 deletions patch/from.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export enum SourcePlatform {
GitHub = "gh",
}
3 changes: 3 additions & 0 deletions patch/from_github.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { crypto, hex, Octokit, toHashString } from "../deps.ts";

import { parseUnifiedDiff } from "./patch.ts";
Expand Down
3 changes: 3 additions & 0 deletions patch/from_github_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { assertEquals, assertNotEquals } from "../test_deps.ts";
import { octokitRestTestClt } from "../ghauth/rest_test.ts";

Expand Down
3 changes: 3 additions & 0 deletions patch/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* patch
* Contains types, functions, and utilities for defining and fetching patches to be used by the different rules.
Expand Down
3 changes: 3 additions & 0 deletions patch/patch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { IHunk, ILineDiff, LineOp } from "./patch_types.ts";

/**
Expand Down
3 changes: 3 additions & 0 deletions patch/patch_types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* The operation on a line in a hunk of a patch.
* @property Unknown Unknown operation.
Expand Down
21 changes: 21 additions & 0 deletions scripts/add_copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# Copyright (c) Fensak, LLC.
# SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

function add_copyright {
local -r pattern="$1"

for i in $(find . -name "$pattern")
do
if ! grep -q Copyright $i
then
cat copyright.txt $i >$i.new && mv $i.new $i
fi
done

deno fmt .
}

add_copyright '*.ts'
add_copyright '*.json5'
4 changes: 4 additions & 0 deletions scripts/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1


3 changes: 3 additions & 0 deletions svcdata/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* svcdata
* Contains functions for interacting with persistent storage backed by deno kv.
Expand Down
3 changes: 3 additions & 0 deletions svcdata/models.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { RuleFnSourceLang } from "../udr/mod.ts";

/**
Expand Down
3 changes: 3 additions & 0 deletions svcdata/queue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { GitHubWebhookEvent, GitHubWebhookEventName } from "../deps.ts";

import { mainKV } from "./svc.ts";
Expand Down
3 changes: 3 additions & 0 deletions svcdata/store.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { crypto } from "../deps.ts";

import { mainKV } from "./svc.ts";
Expand Down
3 changes: 3 additions & 0 deletions svcdata/svc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

// Export a handle to the main KV store. This is only used internal to the package to ensure the same handle is being
// used by all the functions (and thus is not reexported in mod.ts like all other functions).
export const mainKV = await Deno.openKv();
3 changes: 3 additions & 0 deletions test_deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export {
assert,
assertEquals,
Expand Down
3 changes: 3 additions & 0 deletions udr/compile.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import {
babel,
babelPresetEnv,
Expand Down
3 changes: 3 additions & 0 deletions udr/interpreter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Interpreter, Octokit } from "../deps.ts";
import { IPatch } from "../patch/mod.ts";

Expand Down
3 changes: 3 additions & 0 deletions udr/interpreter_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import {
assert,
assertEquals,
Expand Down
3 changes: 3 additions & 0 deletions udr/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* udr - User Defined Rules
* Contains functions and utilities for running user defined rules in Fensak.
Expand Down
3 changes: 3 additions & 0 deletions web/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Application, Router } from "../deps.ts";

import * as middlewares from "../middlewares/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions web/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* web
* Contains the core application code for the webserver driving Fensak.
Expand Down
3 changes: 3 additions & 0 deletions web/routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { Context, GitHubWebhookEventName, Router, Status } from "../deps.ts";

import * as middlewares from "../middlewares/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions worker/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { handleGitHubEvent } from "../ghevent/mod.ts";
import {
enqueueMsg,
Expand Down
3 changes: 3 additions & 0 deletions worker/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

/**
* worker
* Contains the core application code for the Deno KV Queue backed worker driving Fensak.
Expand Down

0 comments on commit f6dfce4

Please sign in to comment.