Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Every pull request requests a review from the owners below.
* @codewithmmak
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Report a failing test, a broken script, or wrong behavior
labels: bug
---

## What happened

## What you expected

## Steps to reproduce

1.
2.

## Environment

- Environment (`TEST_ENV`):
- Command run:
- Bun and Node versions (`bun --version`, `node --version`):

## Logs or report

<!-- Paste the failing output. Remove any credentials, tokens, or personal data first. -->
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Feature request
about: Suggest a new test, tag, environment, or framework capability
labels: enhancement
---

## Problem

## Proposed change

## Alternatives considered
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Summary

<!-- What changed, and why. Link the issue if there is one. -->

## Checks

- [ ] `bun run format:check` passes
- [ ] `bun run lint` passes
- [ ] The CI check passes (Format check, Lint, Smoke tests, CI)
- [ ] New or changed tests are tagged (`@smoke`, `@integration`, or `@prod`)
- [ ] Any `@prod` test is read-only and cannot lock an account

## Docs

- [ ] README and the relevant file in `docs/` are updated, if scripts, environments, tags, or quality gates changed

## Security

- [ ] No credentials, `.env` files, session files, or reports are committed
- [ ] Changes to `.github/workflows` keep permissions minimal and actions pinned to commit SHAs
26 changes: 26 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dependency audit

# Checks installed packages against the npm advisory database every week, or on demand.
on:
schedule:
- cron: "0 5 * * 1"
workflow_dispatch:

permissions:
contents: read

jobs:
audit:
name: Dependency audit
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Setup Bun
uses: ./.github/actions/setup-bun

- name: Audit dependencies
run: bun audit
20 changes: 20 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,23 @@ jobs:
path: reports/
if-no-files-found: ignore
retention-days: 30

report-failure:
name: Report scheduled failure
needs: [nightly]
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: write

steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Open or update the failure issue
run: node scripts/report-scheduled-failure.js "Nightly" "$RUN_URL"
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
20 changes: 20 additions & 0 deletions .github/workflows/prod-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,23 @@ jobs:
path: reports/
if-no-files-found: ignore
retention-days: 30

report-failure:
name: Report scheduled failure
needs: [prod-smoke]
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: write

steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Open or update the failure issue
run: node scripts/report-scheduled-failure.js "Production smoke" "$RUN_URL"
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
20 changes: 20 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Security policy

## Supported versions

Only the latest version on `main` receives fixes.

## Reporting a vulnerability

Do not open a public issue for a security problem.

Report it privately through GitHub: open the repository's **Security** tab and choose **Report a vulnerability**.
Include the affected file or workflow, the steps to reproduce, and the impact you expect.

If private reporting is not available, contact the repository owner through their GitHub profile and ask for a private
channel. Do not send credentials, tokens, or personal data in any report.

## Scope

In scope: the framework code, configuration, and GitHub Actions workflows in this repository.
Out of scope: the OrangeHRM demo application and third-party services the tests call.
10 changes: 10 additions & 0 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ checks. Each job uses a GitHub Environment, which scopes the credentials to that
| Nightly | `.github/workflows/nightly.yml` | 02:00 UTC daily, or manual | `qa` and `staging` (matrix) | Smoke and integration |
| Production smoke | `.github/workflows/prod-smoke.yml` | 06:00 UTC on weekdays, or manual | `production` | Production smoke (`@prod`) |
| Sauce Labs | `.github/workflows/sauce.yml` | manual only | `dev` | Validate and run on Sauce Labs (see [sauce-labs.md](sauce-labs.md)) |
| Dependency audit | `.github/workflows/audit.yml` | 05:00 UTC on Mondays, or manual | none | `bun audit` against the npm advisory database |

## Failed scheduled runs

When a scheduled nightly or production smoke run fails, a `report-failure` job opens one issue titled
`Scheduled run failed: <workflow>`, labelled `scheduled-failure`, and links the run. Later failures add a comment to
that open issue rather than opening another. Close the issue once the failure is fixed. Manual runs do not open issues.

The job requests only `issues: write`, and it runs only for scheduled events. Failure issues are created only after the
scheduled-runs switch is set (see Turning on scheduled runs).

## CI stages

Expand Down
2 changes: 2 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"labels": ["dependencies"],
"schedule": ["before 6am on monday"],
"lockFileMaintenance": {
"enabled": true,
"schedule": ["before 6am on monday"]
Expand Down
71 changes: 71 additions & 0 deletions scripts/report-scheduled-failure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Opens one GitHub issue per failing scheduled workflow, or adds a comment to the open one.
// Usage: node scripts/report-scheduled-failure.js <workflow name> <run URL>
// Needs GH_TOKEN with issues: write. Uses the gh CLI that GitHub-hosted runners provide.
const { execFileSync } = require("child_process");

const LABEL = "scheduled-failure";

/**
* @param {string[]} args
* @returns {string}
*/
function gh(args) {
return execFileSync("gh", args, { encoding: "utf8", env: process.env }).trim();
}

function main() {
const [workflow, runUrl] = process.argv.slice(2);
if (!workflow || !runUrl) {
throw new Error("Usage: node scripts/report-scheduled-failure.js <workflow name> <run URL>");
}

const title = `Scheduled run failed: ${workflow}`;
const open = JSON.parse(
gh([
"issue",
"list",
"--state",
"open",
"--label",
LABEL,
"--limit",
"100",
"--json",
"number,title",
])
);
const existing = open.find((issue) => issue.title === title);

if (existing) {
gh(["issue", "comment", String(existing.number), "--body", `Failed again: ${runUrl}`]);
console.log(`Commented on issue #${existing.number}.`);
return;
}

gh([
"label",
"create",
LABEL,
"--color",
"B60205",
"--description",
"Automatic report from a scheduled run",
"--force",
]);
const body = [
`A scheduled run failed: ${runUrl}`,
"",
"Open the run, read the Summary table, and download the reports artifact.",
"Close this issue once the failure is fixed. Later failures add comments to this issue.",
].join("\n");
const url = gh(["issue", "create", "--title", title, "--body", body, "--label", LABEL]);
console.log(`Opened ${url}`);
}

try {
main();
} catch (error) {
// Reporting must not hide the original failure, so report the problem and exit with an error code.
console.error(`report-scheduled-failure: ${error.message}`);
process.exitCode = 1;
}
Loading