Skip to content

Commit 871f1c5

Browse files
committed
fix: Migrate packages in xtd to denoxtd
Signed-off-by: Yoriyasu Yano <[email protected]>
1 parent 478a9da commit 871f1c5

File tree

9 files changed

+33
-59
lines changed

9 files changed

+33
-59
lines changed

deno.lock

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployments/release/integration_test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
GitHubComponents,
1616
Octokit,
1717
octokitCreateAppAuth,
18+
random,
19+
sleep,
1820
} from "../../deps.ts";
1921

2022
import {
@@ -23,7 +25,6 @@ import {
2325
deleteBranch,
2426
getHeadSHA,
2527
} from "../../ghstd/mod.ts";
26-
import { getRandomString, sleep } from "../../xtd/mod.ts";
2728

2829
/**
2930
* start global constants
@@ -105,7 +106,7 @@ const testCommitterOctokit = new Octokit({
105106

106107
Deno.test("auto-approve happy path for README update", async (t) => {
107108
const repoName = "test-fensak-automated-readme-only";
108-
const branchName = `test/update-readme-${getRandomString(6)}`;
109+
const branchName = `test/update-readme-${random.getRandomString(6)}`;
109110
const defaultBranchName = "main";
110111
let prNum = 0;
111112

@@ -171,7 +172,7 @@ Deno.test("auto-approve happy path for README update", async (t) => {
171172

172173
Deno.test("manual review required for config update", async (t) => {
173174
const repoName = "test-fensak-automated-readme-only";
174-
const branchName = `test/update-config-${getRandomString(6)}`;
175+
const branchName = `test/update-config-${random.getRandomString(6)}`;
175176
const defaultBranchName = "main";
176177
const previousCheckRuns: number[] = [];
177178
let prNum = 0;
@@ -285,7 +286,7 @@ Deno.test("manual review required for config update", async (t) => {
285286

286287
Deno.test("failed required rule fails check", async (t) => {
287288
const repoName = "test-fensak-automated-appdeploy";
288-
const branchName = `test/update-config-${getRandomString(6)}`;
289+
const branchName = `test/update-config-${random.getRandomString(6)}`;
289290
const defaultBranchName = "main";
290291
const previousCheckRuns: number[] = [];
291292
let prNum = 0;
@@ -376,7 +377,7 @@ Deno.test("failed required rule fails check", async (t) => {
376377

377378
Deno.test("passed required rule and passed automerge passes check", async (t) => {
378379
const repoName = "test-fensak-automated-appdeploy";
379-
const branchName = `feature/update-config-${getRandomString(6)}`;
380+
const branchName = `feature/update-config-${random.getRandomString(6)}`;
380381
const defaultBranchName = "main";
381382
const previousCheckRuns: number[] = [];
382383
let prNum = 0;
@@ -446,7 +447,7 @@ Deno.test("passed required rule and passed automerge passes check", async (t) =>
446447

447448
Deno.test("passed required rule and failed automerge requires review", async (t) => {
448449
const repoName = "test-fensak-automated-appdeploy";
449-
const branchName = `feature/update-config-${getRandomString(6)}`;
450+
const branchName = `feature/update-config-${random.getRandomString(6)}`;
450451
const defaultBranchName = "main";
451452
const previousCheckRuns: number[] = [];
452453
let prNum = 0;
@@ -585,7 +586,7 @@ async function waitForFensakStagingCheck(
585586
console.debug(
586587
`Fensak Staging check hasn't run yet on head commit on branch ${branchName} in ${owner}/${repoName}. Retrying after 1 second delay.`,
587588
);
588-
await sleep(sleepBetweenRetries);
589+
await sleep.sleep(sleepBetweenRetries);
589590
}
590591

591592
throw new Error(

deployments/release/sanitycheck_test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
*/
1010

1111
import { assertEquals } from "../../test_deps.ts";
12-
import { Octokit, Status } from "../../deps.ts";
12+
import { Octokit, sleep, Status } from "../../deps.ts";
1313

1414
import { getHeadSHA } from "../../ghstd/mod.ts";
15-
import { sleep } from "../../xtd/mod.ts";
1615

1716
const fensakOrg = "fensak-io";
1817
const fensakRepo = "fensak";
@@ -83,7 +82,7 @@ async function waitForDenoDeploy(octokit: Octokit): Promise<void> {
8382
console.debug(
8483
`Deploy fensak-stage job hasn't run yet on head commit on branch ${fensakRepoDefaultBranch} in ${fensakOrg}/${fensakRepo}. Retrying after 1 second delay.`,
8584
);
86-
await sleep(sleepBetweenRetries);
85+
await sleep.sleep(sleepBetweenRetries);
8786
}
8887

8988
throw new Error(

deps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export type {
2626
} from "https://deno.land/x/[email protected]/mod.ts";
2727
export { oakCors } from "https://deno.land/x/[email protected]/mod.ts";
2828

29-
export * as basemiddlewares from "https://raw.githubusercontent.com/fensak-io/denoxtd/v0.2.1/oakmiddlewares/mod.ts";
29+
export * as basemiddlewares from "https://raw.githubusercontent.com/fensak-io/denoxtd/v0.2.2/oakmiddlewares/mod.ts";
30+
export * as random from "https://raw.githubusercontent.com/fensak-io/denoxtd/v0.2.2/random/mod.ts";
31+
export * as sleep from "https://raw.githubusercontent.com/fensak-io/denoxtd/v0.2.2/sleep/mod.ts";
3032

3133
import winston from "npm:winston@^3.10.0";
3234
import WinstonTransport from "npm:winston-transport@^4.5.0";

svcdata/store.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Copyright (c) Fensak, LLC.
22
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1
33

4-
import { crypto } from "../deps.ts";
4+
import { crypto, sleep } from "../deps.ts";
55

66
import { logger } from "../logging/mod.ts";
7-
import { sleep } from "../xtd/mod.ts";
87

98
import { mainKV } from "./svc.ts";
109
import {
@@ -55,7 +54,7 @@ export async function waitForHealthCheckResult(
5554
i + 1
5655
} of ${maxTries}). Retrying after sleep for ${sleepBetweenTries} seconds.`,
5756
);
58-
await sleep(sleepBetweenTries * 1000);
57+
await sleep.sleep(sleepBetweenTries * 1000);
5958
}
6059
}
6160

web/mgmt_routes.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
// Copyright (c) Fensak, LLC.
22
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1
33

4-
import { config, Context, oakCors, Octokit, Router, Status } from "../deps.ts";
4+
import {
5+
config,
6+
Context,
7+
oakCors,
8+
Octokit,
9+
random,
10+
Router,
11+
Status,
12+
} from "../deps.ts";
513
import type { RouteParams, RouterContext } from "../deps.ts";
614

715
import * as middlewares from "../middlewares/mod.ts";
@@ -20,7 +28,6 @@ import {
2028
} from "../svcdata/mod.ts";
2129
import type { GitHubOrgWithSubscription } from "../svcdata/mod.ts";
2230
import { isOrgManager } from "../ghstd/mod.ts";
23-
import { getRandomString } from "../xtd/mod.ts";
2431

2532
interface APIOrganization {
2633
slug: string;
@@ -66,7 +73,7 @@ export function attachMgmtAPIRoutes(router: Router): void {
6673
}
6774

6875
async function healthCheck(ctx: Context): Promise<void> {
69-
const requestID = getRandomString(6);
76+
const requestID = random.getRandomString(6);
7077
await enqueueMsg({
7178
type: MessageType.HealthCheck,
7279
payload: {

xtd/mod.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

xtd/random.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

xtd/sleep.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)