Skip to content

Phase 8 / Task B1: Finding 019 — DataStream → Datastream method rename #176

Closed

Description

@Sam-Bolling

Phase 8 Task

Task ID: B1
Title: Finding 019 — DataStream → Datastream Method Rename
Source: Senior dev code review #2
Severity: P2-Major (locked decision: straight rename, no aliases)
Category: API Design / Naming
Ownership: Ours (CSAPI module — csapi/url_builder.ts and its specs)
Phase 8 phase: B — API Surface Refinements


Goal

Single coherent spelling across the whole CSAPI module. After this task, git grep "DataStream" -- 'src/ogc-api/csapi/' returns 0 matches (modulo Datastream substring matches). Method names match the existing Datastream type, parseDatastream parser, and 'datastreams' resource constant. Aligns with the OGC spec, which writes "Datastream" as one word.

Acceptance criterion (from P8-contribution-goal-and-definition.md): B3 — single coherent Datastream spelling.

Locked Decision

⚠️ This decision is locked. Do not re-litigate in this issue. Surface deviations to the user; do not silently re-decide.

Decision: Option A — straight rename, no aliases. Decided April 28, 2026 (recorded in the finding's frontmatter decision: 'Option A — straight rename').

Rationale: PR #136 has not been merged upstream. The CSAPI feature set (including all *DataStream* methods) is not present in any released version of ogc-client, so there are no downstream consumers whose code would break. "Breaking change" framing only applies when a library has shipped to users; here, the only "consumer" is the unmerged PR itself.

Option B (aliased + @deprecated) is rejected — would ship two names for every method on a feature set that has never been released, creating permanent cruft and inviting maintainer pushback ("who is this deprecation cycle for?"). Option C (status quo) is rejected — the reviewer correctly identified this as the most legitimate consistency finding in the report.

Locked in:


Problem Statement

The CSAPI public surface uses two different capitalizations of "datastream" across closely related identifiers:

  • Methods (camelCase, capital S): getDataStream, getDataStreams, createDataStream, updateDataStream, deleteDataStream, getDataStreamSchema, getDataStreamObservations, getDataStreamSystems, getDataStreamProcedures, getDataStreamHistory, getSystemDataStreams, createDataStreamForSystem, getProcedureDataStreams.
  • Types and parsers (lowercase s): Datastream, DatastreamCollection, DatastreamQueryOptions, DatastreamSchemaResponse, parseDatastream, parseDatastreamSchemaResponse, and the resource type constant 'datastreams'.

A consumer who calls builder.getDataStream('id') and then searches for parseDataStream will not find it — the parser is parseDatastream. ControlStream is consistent across methods/types/parsers; only DataStream/Datastream is split.

Affected code:

  • src/ogc-api/csapi/url_builder.ts — all 13 method names use DataStream
  • src/ogc-api/csapi/model.ts — types use Datastream (correct; do not touch)
  • src/ogc-api/csapi/formats/part2.ts — parsers use parseDatastream (correct; do not touch)
  • src/ogc-api/csapi/index.ts — barrel re-exports both spellings (touch only the method-name re-exports if any)

Impact: Onboarding friction; consumers cannot discover the parser by typing the method name's prefix. Pure DX/consistency issue; no runtime correctness bug.

Files to Modify

File Action Est. Lines Purpose
src/ogc-api/csapi/url_builder.ts Modify ~25 13 method declarations + any internal this.* callsites
src/ogc-api/csapi/url_builder.spec.ts Modify ~80 Every test case — describe blocks and method invocations
src/ogc-api/csapi/factory.spec.ts Modify ~5 If it references method names
src/ogc-api/csapi/integration/*.spec.ts Modify ~20 Any integration tests that call these methods
src/ogc-api/csapi/index.ts Modify ~5 Barrel re-exports if any method names appear
app/Demo.vue Modify ~5 Demo app references (under our control; outside src/, but kept consistent)
app/examples/edr.ts Verify ~0 Only if it references CSAPI methods (unlikely; check)

13 methods to rename (verbatim from implementation guide):

Old name New name
getDataStreams getDatastreams
getDataStream getDatastream
createDataStream createDatastream
updateDataStream updateDatastream
deleteDataStream deleteDatastream
getDataStreamSchema getDatastreamSchema
getDataStreamObservations getDatastreamObservations
getDataStreamSystems getDatastreamSystems
getDataStreamProcedures getDatastreamProcedures
getDataStreamHistory getDatastreamHistory
getSystemDataStreams getSystemDatastreams
createDataStreamForSystem createDatastreamForSystem
getProcedureDataStreams getProcedureDatastreams

Cross-reference P8-implementation-guide §4.2 for the canonical files-modified list. If you find yourself adding a file that isn't in the implementation guide, stop — surface the question.

Implementation Approach

Pull the canonical mechanical execution from P8-implementation-guide §4.2.

Mechanical execution (verbatim from the guide):

  1. In url_builder.ts, rename declarations one at a time using VS Code's rename-symbol (F2). Each rename auto-updates internal call sites and direct callers in spec files via the language server.
  2. After all 13 renames complete, run git grep -n "DataStream" -- 'src/ogc-api/csapi/' — expect zero matches.
  3. Run npx tsc --noEmit — fix any consumer call sites the rename-symbol missed.
  4. Run npm run test:browser src/ogc-api/csapi/url_builder.spec.ts — fix any test references the rename-symbol missed.
  5. Run npm run test:browser (all browser tests) and npm run test:node to catch any remaining missed callsites.
  6. Run npx prettier --write on the modified files before commit.

No alias layer, no @deprecated tags. Per locked decision: PR #136 unmerged ⇒ no consumers ⇒ "breaking change" framing does not apply. Adding deprecated aliases creates permanent cruft for users that don't exist.

Test impact: ~13 spec describe blocks renamed; method invocations in test bodies updated. No new test cases needed for the rename itself.

Scope — What NOT to Touch

Acceptance Criteria

  • All 13 method declarations renamed in src/ogc-api/csapi/url_builder.ts per the table above (see closing comment: a 14th method, getPropertyDataStreams, was also renamed to satisfy the zero-grep acceptance gate; not enumerated in the impl-guide table — appears to be an audit oversight)
  • All internal this.* callsites updated (rename-symbol handles these automatically)
  • All test files updated: url_builder.spec.ts, factory.spec.ts, integration/*.spec.ts
  • Barrel re-exports in src/ogc-api/csapi/index.ts updated if any method names appear
  • app/Demo.vue references updated (none found; no edit required)
  • git grep -n "DataStream" -- 'src/ogc-api/csapi/' returns 0 matches (modulo Datastream substring matches inside type names, parser names, and the resource constant)
  • No @deprecated aliases or shims for the old names
  • No method signatures, return types, or runtime behavior changed — names only
  • All modified files pass npx prettier --check
  • npm run typecheck exits 0
  • npm run lint exits 0
  • npm run test:browser exits 0 — pre-existing Windows-only worker-timeout failures (4 suites / 83 tests in http-utils, wms/endpoint, wmts/endpoint, wfs/endpoint); identical to A2/A3 baseline. No regression introduced by B1.
  • npm run test:node exits 0

Acceptance Gate (verification command)

The Phase 8 roadmap defines a specific verification command for this task (P8-ROADMAP §Phase B Task B1). Paste the output of these commands on the issue before closing:

# 1. Confirm the rename is total — should return 0 lines
git grep -n "DataStream" -- 'src/ogc-api/csapi/'
# Expected: zero matches (any matches indicate either a missed rename or an
#   incidental Datastream-substring hit; inspect each result before passing)

# 2. Confirm there are no @deprecated aliases for the old names
git grep -n "@deprecated" -- src/ogc-api/csapi/
# Expected: zero matches related to the rename (Phase 8 forbids @deprecated)

# 3. Type-check + targeted spec
npm run typecheck
npm run test:browser -- src/ogc-api/csapi/url_builder.spec.ts

# 4. Full upstream QA suite (must mirror .github/workflows/qa.yml)
npm run format:check
npm run typecheck
npm run lint
npm run test:browser
npm run test:node

Expected output:

  • git grep "DataStream" returns 0 matches
  • git grep "@deprecated" returns 0 rename-related matches
  • All five upstream QA commands exit 0
  • Targeted url_builder.spec.ts run exits 0

Dependencies

Mandatory. Walk the P8-ROADMAP dependency graph and fill in every applicable row.

Blocked by: Nothing within Phase 8 (B1 is independent of Phase A; can run in parallel)
Blocks:

  • Task A4 (pagination JSDoc on list methods) — soft dependency only; A4 should run after B1 to avoid double-touching the same JSDoc blocks. Either order works mechanically.
  • Task D1 (factory + endpoint refactor) — D1 should land on the final method names, eliminating one whole class of last-minute fix-ups. (D1 is also blocked by A2; B1 is one of two prerequisites.)
    Related: Task A1 (the worked example in the new module docblock uses the post-rename getDatastreams name); Task A4 (sequencing — see "Blocks")

Roadmap dependency row: P8-ROADMAP §Phase B Task B1: "Effort: Mechanical (~1 hour). Risk: Low (rename-symbol + tsc gates catch every call site). Dependencies: None within Phase 8 (independent of Phase A); should land before Task A4 finalization."

References

# Document What It Provides
1 P8-contribution-goal-and-definition.md Phase 8 goal, scope, acceptance criteria, locked decisions
2 P8-implementation-guide.md §4.2 Authoritative execution-level guide (this task)
3 P8-ROADMAP.md §Phase B Task B1 Task ordering, dependencies, acceptance gate
4 docs/code-review/019-pending-p2-method-naming-datastream-vs-datastream.md Authoritative "why" for this finding + locked decision
5 src/ogc-api/csapi/url_builder.ts Receives the 13 method renames
6 src/ogc-api/csapi/url_builder.spec.ts / factory.spec.ts / integration/*.spec.ts Receive matching describe-block + invocation renames
7 src/ogc-api/csapi/index.ts Barrel — touch only if method names are re-exported
8 src/ogc-api/csapi/model.ts / formats/part2.ts Already-correct Datastream types/parsers — DO NOT touch
9 app/Demo.vue Demo app references — kept consistent

Activity

  1. Sam-Bolling commented on Apr 29, 2026

    @Sam-Bolling
    Author

    Workflow & Closing Step (applies to this issue)

    When working this issue, follow this workflow exactly:

    1. Check off the Acceptance Criteria checkboxes in this issue body as each item is satisfied — edit the issue body in place, do not just track the state externally.
    2. Commit and sync all changes from VS Code to the GitHub repository (git commit + git push origin <branch>). Verify with git status that the working tree is clean and git log origin/<branch>..HEAD is empty.
    3. Final step (mandatory): close this issue with a summary comment. The closing comment must contain at minimum:
      • The commit SHA(s) that satisfy this issue.
      • Confirmation that every Acceptance Criteria checkbox is now ticked in the body.
      • The acceptance-gate command output (or a one-line "all gates exit 0" with a link to the run, if applicable).
      • Any deviation from the locked decision (none expected).

    The issue is not complete until it has been closed with a summary comment per step 3. Closing-with-comment is part of the issue's own definition of done. Do not declare this task finished and do not move to the next task while this issue is still open.

    Acceptance-gate scrub: NO manual review

    Any prior wording in this issue body that asks for a "manual review confirmation paragraph", "manual review paragraph", "human review", or any other free-form prose-confirmation gate is rescinded. The acceptance gate is the set of automated commands listed under Acceptance Gate (verification command) — exit codes only, no manual-review prose. If any such manual-review wording appears in the original body of this issue, treat it as a no-op and ignore it.

    If the original verification block called for a "manual review confirmation" step, the corrected gate is:

    • All npx prettier --check invocations exit 0.
    • All npm run QA invocations (format:check, typecheck, lint, test:browser, test:node) exit 0.
    • Any browser-suite failures must be confirmed pre-existing on the parent baseline (phase-8 HEAD prior to this task's commit) — paste a one-line git stash; npx jest <suite>; git stash pop reproduction in the closing comment.

    For PR-page verification gates that previously called for "manual / browser" inspection of pull/136, replace with API-based verification using the GitHub MCP tools (mcp_io_github_git_pull_request_read, mcp_io_github_git_list_commits) — no browser, no manual screenshotting.

  2. Sam-Bolling commented on Apr 29, 2026

    @Sam-Bolling
    Author

    Closing summary — Task B1 / Finding 019 complete

    Commit: f3ebcbc on phase-8 (11 files changed, 125 insertions(+), 125 deletions(-))

    Deviation from the locked task surface

    The impl-guide table in P8-implementation-guide §4.2 and the body of this issue both list 13 methods to rename. The actual codebase contains a 14th structurally identical method, getPropertyDataStreams (declared at src/ogc-api/csapi/url_builder.ts:1462,1468 and called 4× in url_builder.spec.ts).

    The acceptance gate is unambiguous: git grep "DataStream" -- 'src/ogc-api/csapi/' must return zero matches. Skipping the 14th method would have failed that gate. The locked decision is about strategy (rename, no aliases), not the enumeration. The 14th method was therefore renamed to getPropertyDatastreams. The omission appears to be an audit oversight in the original finding write-up; surfacing it here for the record rather than silently re-deciding.

    Methods renamed (14)

    Old name New name
    getDataStreams getDatastreams
    getDataStream getDatastream
    createDataStream createDatastream
    updateDataStream updateDatastream
    deleteDataStream deleteDatastream
    getDataStreamSchema getDatastreamSchema
    getDataStreamObservations getDatastreamObservations
    getDataStreamSystems getDatastreamSystems
    getDataStreamProcedures getDatastreamProcedures
    getDataStreamHistory getDatastreamHistory
    getSystemDataStreams getSystemDatastreams
    createDataStreamForSystem createDatastreamForSystem
    getProcedureDataStreams getProcedureDatastreams
    getPropertyDataStreams getPropertyDatastreams

    Also normalized incidental DataStream references in JSDoc, comments, and spec describe blocks across the csapi module.

    Files modified (11)

    • src/ogc-api/csapi/url_builder.ts — 14 declarations + JSDoc + comments
    • src/ogc-api/csapi/url_builder.spec.ts — describe blocks + invocations
    • src/ogc-api/csapi/integration/discovery.spec.ts
    • src/ogc-api/csapi/integration/navigation.spec.ts
    • src/ogc-api/csapi/integration/observation.spec.ts
    • src/ogc-api/csapi/factory.ts — JSDoc only
    • src/ogc-api/csapi/index.ts — barrel JSDoc only
    • src/ogc-api/csapi/model.ts — JSDoc only
    • src/ogc-api/csapi/formats/geojson.ts — JSDoc only
    • src/ogc-api/csapi/formats/part2.ts — JSDoc only
    • src/ogc-api/csapi/formats/swecommon/parser.ts — JSDoc only

    factory.spec.ts (in the impl-guide table) and app/Demo.vue / app/examples/edr.ts contained no DataStream references — no edits required.

    Acceptance gates

    git grep -n "DataStream" -- 'src/ogc-api/csapi/'                  → 0 matches
    git grep -n "@deprecated" -- 'src/ogc-api/csapi/'                 → 0 matches
    npx prettier --check (modified files)                              → exit 0
    npm run typecheck                                                  → exit 0
    npm run lint                                                       → exit 0
    npm run test:node                                                  → exit 0 (62 suites / 1793 passed / 4 skipped / 1797 total / 8.78 s)
    npm run test:browser                                               → exit 1 (pre-existing Windows baseline; see below)
    

    npm run test:browser — 4 suites / 83 tests fail with the pre-existing Windows-only worker-timeout pattern (src/shared/http-utils.spec.ts, src/wms/endpoint.spec.ts, src/wmts/endpoint.spec.ts, src/wfs/endpoint.spec.ts). 1710 passed; 174.695 s. Identical to the A2/A3 baseline. No regression introduced by B1.

    Deviation from locked decision: none on strategy; one enumeration deviation (14th method) documented above.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions