# ows-accounting Decommission

**TL;DR:** [`theorchard/ows-accounting`](https://github.com/theorchard/ows-accounting) (abacus team) is being decommissioned under [ACC-10631](https://theorchard.atlassian.net/browse/ACC-10631). Datadog showed zero real production request traffic — the only live traffic was ows-grass QA contract tests. Verification surfaced several additional (mostly dormant / flag-gated) consumers, all of which are being removed. This doc tracks every PR, the recommended merge order, the Jenkins and manual-admin work that cannot be done via PR, and what is intentionally left untouched.

## Overview

The service `ows-accounting` no longer serves real traffic. A Datadog review found zero genuine production request volume; the only live requests were QA contract tests driven by `ows-grass`. Because a handful of consumers still reference the service — most dormant or flag-gated — the decommission removes each reference before tearing down the infrastructure, so nothing calls `ows-accounting` once it is gone.

The teardown spans code-removal PRs (consumers, dead references, test suites), infrastructure PRs in `terraform-infra` (ECS, proxy, Fivetran, ECR, Snowflake service users, and the prod Aurora RDS), Jenkins job removals that Terraform does not manage, and a small set of manual admin actions (repo archival, data-migration verification).

## PR Inventory

| Repo | PR | What it does |
|------|----|--------------|
| theorchard/ows-grass | [#877](https://github.com/theorchard/ows-grass/pull/877) | Remove tavern tests, service registration, and `rules/ows-accounting.yml` |
| theorchard/terraform-infra | [#36032](https://github.com/theorchard/terraform-infra/pull/36032) (prod) | Remove ECS service, proxy, Fivetran connector, ECR repo, prod jwt entry, and fivetran-rds-proxy entry — **DESTROYS the `prod-ows-accounting` Aurora RDS** |
| theorchard/terraform-infra | [#36031](https://github.com/theorchard/terraform-infra/pull/36031) (qa) | Remove `qa/ows-accounting/` and the qa jwt entry |
| theorchard/terraform-infra | [#36033](https://github.com/theorchard/terraform-infra/pull/36033) (uat) | Remove the uat jwt entry |
| theorchard/terraform-infra | [#36030](https://github.com/theorchard/terraform-infra/pull/36030) (github) | Remove `prod/github/ows-accounting` repo management |
| theorchard/terraform-infra | [#36060](https://github.com/theorchard/terraform-infra/pull/36060) (snowflake) | Remove `PROD_OWS_ACCOUNTING` & `QA_OWS_ACCOUNTING` Delphi service users |
| theorchard/bff-feature-fm | [#92](https://github.com/theorchard/bff-feature-fm/pull/92) | Remove the `ows_accounting` model; removes `GET /budget-caps` and `GET /<account_type>/<id>/campaign-budget` endpoints (**behavioral change**) |
| theorchard/frontend-homepage | [#258](https://github.com/theorchard/frontend-homepage/pull/258) | Remove the Recent Revenue widget chain (was already orphaned) |
| theorchard/frontend-reporting | [#476](https://github.com/theorchard/frontend-reporting/pull/476) | Remove the Expected Reserve Payouts feature + `/accounting/physicalreserves` route |
| theorchard/frontend-accounting | [#371](https://github.com/theorchard/frontend-accounting/pull/371) | Add README deprecation notice (dead app; recommend archival) |
| theorchard/cucumber-cypress-tests | [#4666](https://github.com/theorchard/cucumber-cypress-tests/pull/4666) | Remove dead util + report-download E2E coupling |
| theorchard/cucumber_tests | [#2619](https://github.com/theorchard/cucumber_tests/pull/2619) | Remove `OwsAccounting` service + domain + 3 steps + 5 scenarios |
| theorchard/graphql-product | ACC-10631 PR | Remove unused `OWS_ACCOUNTING` / `OWS_ACCOUNTING_URL` constants |
| theorchard/graphql-collaborator | ACC-10631 PR | Remove unused `OWS_ACCOUNTING` constant |
| theorchard/docs-swagger-ui | ACC-10631 PR | Remove the swagger registry entry |
| theorchard/endpoint-collections | ACC-10631 PR | Remove the `ows-accounting.json` collection |
| theorchard/foxglove | ACC-10631 PR | Remove the service-catalog entry |
| theorchard/python-github-vulnerability-scanner | ACC-10631 PR | Remove the `app_family_map` entry |
| theorchard/abacus-docs | this PR | Tracking doc |

## Recommended Execution / Merge Order

The order below is dependency-aware: consumers stop calling the service before the service is torn down, and QA CI stays green throughout.

1. **Merge consumer code-removal PRs first** so nothing calls `ows-accounting`: bff-feature-fm#92, frontend-homepage#258, frontend-reporting#476, frontend-accounting#371, ows-grass#877, and the dead-reference PRs (graphql-product, graphql-collaborator, docs-swagger-ui, endpoint-collections, foxglove, python-github-vulnerability-scanner). These have no ordering constraints and can go anytime.
2. **Merge the test-suite PRs** (cucumber-cypress-tests#4666, cucumber_tests#2619) *before* the QA infra teardown, so QA CI stays green.
3. **Remove the Jenkins jobs** (see below) after the test PRs merge.
4. **Apply the infra teardown** in this order:
   1. QA (#36031) and UAT (#36033).
   2. PROD (#36032) — this **destroys the RDS**, so confirm the Snowflake / Fivetran data migration is complete first.
   3. Snowflake service users (#36060).
   4. Apply the GitHub repo-management PR (#36030) before the manual repo archival.
5. **Manual admin actions last** (see below).

## Jenkins

Jenkins jobs are **not** managed by Terraform, and — verified by inspection — they are **not** defined as code anywhere in Git either:

- [`theorchard/jenkins-config`](https://github.com/theorchard/jenkins-config) (the Job DSL / org-folder seed) contains **zero** `ows-accounting` / `frontend-accounting` references, and does not manage the Ruby `cucumber_tests` repo at all.
- [`theorchard/terraform-jenkins`](https://github.com/theorchard/terraform-jenkins) manages Jenkins **clusters** (controllers / agents) only — no job definitions.
- Org-wide, the strings `ows-accounting-cucumber-tests` and `frontend-accounting-cucumber-tests` appear in exactly one place: descriptive comments in `cucumber_tests/Rakefile` (`desc "Used by <name> job in Jenkins"`). Nothing defines them as code.

**Conclusion:** these are legacy freestyle jobs configured directly in the Jenkins UI (`pipeline.theorchard.io`). No PR can remove them — deletion is a manual Jenkins-UI action (see below).

| Jenkins job | Definition | Disposition |
| --- | --- | --- |
| `ows-accounting` build pipeline | Multibranch, auto-discovered from the repo `Jenkinsfile` | Auto-removed when `theorchard/ows-accounting` is archived (delete the folder manually if it lingers). |
| `ows-accounting-cucumber-tests` | Freestyle job in the Jenkins UI | **Delete.** Fully orphaned once cucumber_tests#2619 merges — its `rake ows_accounting` task is removed, so the job can only error. |
| `frontend-accounting-cucumber-tests` | Freestyle job in the Jenkins UI | ⚠️ Its `rake frontend:accounting` task **still exists** after #2619 (only the ows-accounting-coupled scenarios were stripped). Delete **only** as part of retiring the `frontend-accounting` app (#371); if deleted, a follow-up should also drop the `frontend:accounting` task + remaining scenarios from `cucumber_tests`. Otherwise leave it running. |

## Manual Admin Actions

These cannot be done through a PR:

- Archive [`theorchard/ows-accounting`](https://github.com/theorchard/ows-accounting) and [`theorchard/frontend-accounting`](https://github.com/theorchard/frontend-accounting).
- In the Jenkins UI (`pipeline.theorchard.io`), delete the freestyle job `ows-accounting-cucumber-tests` (after cucumber_tests#2619 merges). These jobs are UI-defined — not in `jenkins-config` — see the Jenkins section above.
- Decide on `frontend-accounting-cucumber-tests` as part of the `frontend-accounting` app retirement (see the Jenkins table); it still runs a valid task after #2619, so do not delete it reflexively.
- Verify the RDS → Snowflake data was migrated **before** applying terraform-infra#36032 (which destroys the prod Aurora RDS).

## Left Intentionally Untouched

The following are append-only migration history and are not edited retroactively:

- Historical SQL migration / changelog scripts in [`theorchard/database`](https://github.com/theorchard/database) (grant scripts).
- QA data-sanitisation user scripts in [`theorchard/python-rds-utils`](https://github.com/theorchard/python-rds-utils).

## Jira

| Ticket | Scope |
|--------|-------|
| [ACC-10631](https://theorchard.atlassian.net/browse/ACC-10631) | ows-accounting decommission |
