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
95 changes: 0 additions & 95 deletions .github/scripts/wait-for-image-published.sh

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/deploy-dev.yaml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/deploy-prd.yaml

This file was deleted.

29 changes: 7 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ The map API keeps the same gates as the 21.gifts API.

## Branches

| Branch | Purpose | Image |
| --------- | -------------------------------------------------------- | -------------------------- |
| `develop` | Integration branch. Open pull requests here. | `opencryptopay/api:beta` |
| `main` | Production. Moves only through the release pull request. | `opencryptopay/api:latest` |
| Branch | Purpose |
| --------- | -------------------------------------------------------- |
| `develop` | Integration branch. Open pull requests here. |
| `main` | Production. Moves only through the release pull request. |

- Land work on `develop` through a feature branch and a pull request. Do not push `develop` or `main` directly.
- A push to `develop` publishes `:beta` for the dev environment and runs CI on that commit. The release pull request shows that same CI run.
- A push to `main` publishes `:latest` for production.
- `auto-release-pr.yaml` opens `Release: develop -> main` when `develop` is ahead of `main`. A normal production publish waits for that pull request. The dev and production workflows also have a manual run, and that run publishes `:beta` or `:latest` for whichever commit you start it on.
- A push to `develop` runs CI on that commit. The release pull request shows that same CI run.
- This repository does not publish a container image.
- `auto-release-pr.yaml` opens `Release: develop -> main` when `develop` is ahead of `main`.
- Never force-push, and never amend a published commit.

## Commit messages
Expand All @@ -38,19 +38,4 @@ Do not lower a coverage threshold to land a change. A genuinely unreachable bran
| Workflow | Trigger | Action |
| ---------------------- | ----------------------------------- | ----------------------------------------------------------------------- |
| `ci.yaml` | Pull request, and push to `develop` | Typecheck, lint, handbook, e2e-check, test (100% coverage), build, e2e |
| `deploy-dev.yaml` | Push to `develop` | Build and push `opencryptopay/api:beta`, then wait for the deploy |
| `deploy-prd.yaml` | Push to `main` | Build and push `opencryptopay/api:latest`, then wait for the deploy |
| `auto-release-pr.yaml` | Push to `develop` | Open the release pull request (`develop` → `main`) when there is a diff |

Images target `linux/arm64`.

Deploy workflows need these Actions secrets:

| Secret | Purpose |
| ----------------- | ----------------------------------------------------- |
| `DOCKER_USERNAME` | Registry username for the image push |
| `DOCKER_PASSWORD` | Registry token for the image push |
| `DISPATCH_TOKEN` | Token that sends `image-published` and reads that run |
| `DISPATCH_REPO` | `owner/repo` that receives `image-published` |

If `DISPATCH_TOKEN` or `DISPATCH_REPO` is missing, deploy fails after the image push. The job then waits for the infrastructure run titled `image-published opencryptopay/api:<tag> <sha>` and fails when that run does not succeed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The process listens on port `3000` unless `PORT` is set. The database file is `d

## Branches

Pull requests target `develop`. A push there publishes `opencryptopay/api:beta`. `main` publishes `opencryptopay/api:latest` and moves only through the release pull request from `develop`.
Pull requests target `develop`. `main` moves only through the release pull request from `develop`. This repository does not publish a container image.

## Checks

Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/map/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ describe('MAP_PLACE_SCHEMA_SQL', () => {

describe('MemoryMapPlaceStore', () => {
it('inserts once and lists newest first without changing the first row', () => {
const store = new MemoryMapPlaceStore();
let tick = 0;
const store = new MemoryMapPlaceStore(() => new Date(Date.UTC(2026, 0, 1, 0, 0, tick++)));
const first = store.insertIfNew(input);
expect(first.created).toBe(true);
const second = store.insertIfNew({ ...input, name: 'Other', lat: 1 });
Expand Down
Loading