Skip to content

Staging#1928

Merged
JoshuaSBrown merged 75 commits intomasterfrom
staging
Apr 1, 2026
Merged

Staging#1928
JoshuaSBrown merged 75 commits intomasterfrom
staging

Conversation

@JoshuaSBrown
Copy link
Copy Markdown
Collaborator

@JoshuaSBrown JoshuaSBrown commented Apr 1, 2026

Summary by Sourcery

Bug Fixes:

  • Ensure schema creation requests append a :0 version suffix when no version is provided in the ID to align behavior across implementations.

JoshuaSBrown and others added 30 commits November 17, 2025 07:34
* [DAPS-1585] - update: dependencies, upgrade ssl dependency. 3.2.5 (#1646)
* [DAPS-1605] - fix: scripts, install_foxx.sh by splitting ssl_args (#1623)
* [DAPS-1651] - refactor: scripts, compose, univify treatment of env variables in compose env generator (#1656) (#1658)
* [DAPS-1675] - feature: foxx, adding the logger functions for future PR's (#1675)
* [DAPS-1659] - refactor: scripts, remove dependencies install scripts (#1660)
* [DAPS-1670] - feature: common, core, repo, python_client, web, allow passing repo types in protobuf messages (#1670)
* [DAPS-1671] - feature: foxx, add repository and execution strategy types (#1672)
* [DAPS-1661] - refactor: compose, scripts, remove remaining occurences of zeromq system secret. (#1661)
* [DAPS-1522] - refactor: foxx, user router logging improvements, remove non helpful logs from tasks.js (#1629)
* [DAPS-1691] - refactor: foxx, adjust validation.js swap g_lib with error_code require rem… (#1691)
* [DAPS-1692] - tests: ci, End-to-end web tests, fix flaky test (#1693)
* [DAPS-1694] - refactor: foxx, move permissions functions from support.js to lib/permissions (#1695)
* [DAPS-1685] - feature: compose, enable arangodb ssl (#1687)
* [DAPS-1700] - fix: ci, limit arangodb job output to last 3 hours. (#1701)
* [DAPS-1676] - feature: foxx, arango add factory for repositories for metadata and globus (#1697)
* [DAPS-1718] - feature: web, core, python client, Protobuf ExecutionMethod enum, add RepoAllocationCreateResponse (#1719)
* [DAPS-1713] - refactor: core, web, python client, protobuf, allow optional fields when creating repo to support metadat… (#1714)
* [DAPS-1715] - refactor: core, make path, pub_key, address, endpoint optional in repoCreateRequest (#1716)
* [DAPS-1705] - feature: foxx, integrate metadata globus factory repo router create (#1706)
* [DAPS-1688] - update: dependencies, core, repo, authz, gcs, Crypto libssl switched to version 3 globus_sdk version pinned (#1689)
* [DAPS-1729] - fix: ci, downstream datafed dependencies pipelines are building the container image from incorrect sha (#1732)
* [DAPS-1711] - refactor: foxx standardize repo response schema (#1712)
* [DAPS-1725] - refactor: remove confusing apache conf file. (#1728)
* [DAPS-1707] - update: dependencies, web, update web dependencies before install (#1709)
* [DAPS-1522] - refactor: foxx, task router logging improvements (#1648)
* [DAPS-1522] - refactor: foxx, query router logging improvements (#1627)
* [DAPS-1735] - bug: foxx, remove duplicate user_router test (#1736)
* [DAPS-1731] - reature: scripts, compose, add scripts to generate globus credentials for web service (#1731)
* [DAPS-1725] - refactor: tests, mock core server centralized (#1726)
* [DAPS-1741] - update: scripts, native client id in intialize_globus_endpoint and globus_clea… (#1741)
* [DAPS-1745]  - fix: scripts, account for nested client credentials. (#1746)
* [DAPS-1725-2] - fix; tests, centralized mock core service libraries fixed (part 2) (#1747)
* [DAPS-1742] - refactor script replace os.path.join with urllib.parse.urljoin (#1744)
* [DAPS-1749] - refactor: cmake, set cmake policy to silence noisy warning. (#1750)
* [DAPS-1522] - refactor: foxx, feature tag router logging improvements (#1734)
* [DAPS-1378] - fix: web, mapping of multiple globus accounts. (#1753)
* [DAPS-1756] - fix: scripts, foxx, add retries and connection check to install_foxx.sh script. (#1757)
* [DAPS-1522] - refactor: foxx, Version Router Logging Improvements (#1758)
* [DAPS-1737] - refactor: compose, cleanup arango ssl env variables (#1765)
* [DAPS-1766] - fix: ci, python client provisioning job
* [DAPS-1663] - feature: core Service, adding Correlation ID to Logging (#1704)

Co-authored-by: Aaron Perez <perezam@ornl.gov>
Co-authored-by: AronPerez <aperez0295@gmail.com>
Co-authored-by: Blake Nedved <nedvedba@ornl.gov>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: nedvedba <145805866+nedvedba@users.noreply.github.com>
Co-authored-by: Austin Hampton <amh107@latech.edu>
Co-authored-by: Austin Hampton <44103380+megatnt1122@users.noreply.github.com>
Co-authored-by: Blake Nedved <blakeanedved@gmail.com>
Co-authored-by: Polina Shpilker <infinite.loopholes@gmail.com>
…se. (#1778)

[DAPS-1786] - Web tests, refactor: add test for hitting password reset. (#1787)
… tests (#1779)

* [DAPS-1775] - fix: core, foxx, add missing {}, foxx query_router add params object schema to routes. (#1781)
* [DAPS-1777] - fix: foxx, user_router fix regression in missing response. (#1778)
* [DAPS-1786] - refactor: web tests, add test for hitting password reset. (#1787)
* [DAPS-1277] - fix: mock, core, common, PROXY_BASIC_ZMQ and PROXY_CUSTOM correctly defined
* [DAPS-1790] - fix: common, core, repo, zmq assertion failure during EXCEPT call due to callin zmq_msg with invalid state after closing it.
* [DAPS-1791] - fix: build, python client, requirements.txt was being moved to a folder named requirements.txt during cmake configure script.
* refactor: only print subset of user properties.

* chore: Auto-format JavaScript files with Prettier
Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
JoshuaSBrown and others added 26 commits February 2, 2026 14:58
* [DAPS-1825] - upgrade (dependencies) pin to new datafed dependencies submodule with updated openssl (#1826)
Co-authored-by: JoshuaSBrown <brownjs@ornl.gov>
* [DAPS-1837] - refactor: core server to support proto3 (#1844)
* [DAPS-1845] - refactor repo server to use proto3 (#1846)
* [DAPS-1847] - refactor: python package to be compatible with proto3 envelope (#1849)
* [DAPS-1848] - refactor: update authz files to use proto3. (#1851)
* [DAPS-1850] - refactor web server proto3 (#1852)
#1861) (#1866)

* fix: prevent defaults being set to undefined, and interpret numbers and enums as strings.

* chore: Auto-format JavaScript files with Prettier

Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
* fix: prevent defaults being set to undefined, and interpret numbers a… (#1861)

* fix: prevent defaults being set to undefined, and interpret numbers and enums as strings.

* chore: Auto-format JavaScript files with Prettier

* fix: version numbers from proto3 messages follow camel case. (#1868)

---------

Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
* refactor: core server files refactored to support re-use in the mock implementation

* refactor: changed mock core server to work with proto3 and reusue abstractions from core server.

* fix: prevent defaults being set to undefined, and interpret numbers a… (#1861)

* fix: prevent defaults being set to undefined, and interpret numbers and enums as strings.

* chore: Auto-format JavaScript files with Prettier

* fix: version numbers from proto3 messages follow camel case. (#1868)

* docs: fix jsdoc error.

* [DAPS-1862] - fix allocation change failure (#1864)

* [DAPS-1663] Adding LogContext to dbGetRaw, Correlation_ID to dbMaintenance, metricThread and task_worker (#1885)

Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
Co-authored-by: Joshua S Brown <brownjs@ornl.gov>

* fix: mock_core server build (#1890)

* [DAPS-1887] - refactor: facility fuse, remove dead code. (#1888)

* [DAPS-1857] - feature: python client, tests, support schema functions, to hit feature parity with web ser… (#1859)

* [DAPS-1855] - feature, core, add schema factory to decouple schema logic (#1891)

* [DAPS-1896] - feature: foxx, schema format and type added to schema create API (#1897)

* [DAPS-1893] - feature: common, proto3 add fields for schema type, format, and metadata format (#1894)

* [DAPS-1830-1] - core foxx refactored json schema integration 1 (#1892)

* [DAPS-1857-2] python client schema support (#1895)

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* [DAPS-1830-2] - core foxx refactored json schema integration (#1899)

* [DAPS-1902] - core, common, feat: get schema api client into compliance with API spec file. (#1903)

* [DAPS-1906-1] - feature: add core unit testing to CI (#1907)

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* [DAPS-1830-3] - core foxx refactored json schema integration 3 1827 (#1898)

* [DAPS-1910] - upgrade: playwright 1.51.1 version. (#1911)

* [DAPS-1914] - bug, web schema id name version mismatch (#1915)

* [DAPS-1913] - refactor: foxx ci test scripts consolidate database name and default to different database for tests (#1917)

* [DAPS-1916] - tests add integration test for schema client handler to cmake (#1918)

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: JoshuaSBrown <brownjs@ornl.gov>
Co-authored-by: Joshua S Brown <joshbro42867@yahoo.com>
Co-authored-by: Austin Hampton <44103380+megatnt1122@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* [DAPS-1912] - refactor: register linkml storage engine with schema handler (#1912)

* [DAPS-1919] - python, web support linkml schema (#1921)

* [DAPS-1923] - update: version numbers bumped. (#1923)

---------

Co-authored-by: Austin Hampton <44103380+megatnt1122@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 1, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds automatic ":0" version suffix to schema IDs without an explicit version when handling /api/sch/create requests, aligning Node web service behavior with Python CommandLib.

Sequence diagram for /api/sch/create schema ID version normalization

sequenceDiagram
    actor Client
    participant WebServer
    participant SchemaService

    Client->>WebServer: POST /api/sch/create (body.id may lack version)
    WebServer->>WebServer: validate_schema_id
    alt id_has_no_version_suffix
        WebServer->>WebServer: body.id = body.id + :0
    else id_already_has_version
        WebServer->>WebServer: keep body.id unchanged
    end
    WebServer->>SchemaService: SchemaCreateRequest(body)
    SchemaService-->>WebServer: SchemaCreateReply
    WebServer-->>Client: JSON reply
Loading

Flow diagram for schema ID :0 suffix handling in /api/sch/create

flowchart TD
    A[Receive POST /api/sch/create] --> B[Read body.id]
    B --> C{Is body.id set?}
    C -- No --> D[Proceed without id modification]
    C -- Yes --> E{Does body.id contain colon}
    E -- Yes --> F[Keep body.id unchanged]
    E -- No --> G[Set body.id = body.id + :0]
    D --> H[Send SchemaCreateRequest]
    F --> H
    G --> H
    H --> I[Return JSON reply to client]
Loading

File-Level Changes

Change Details Files
Normalize schema IDs on create by appending a default :0 version suffix when no version is provided.
  • Before sending SchemaCreateRequest, check if request body has an id field and whether it lacks a colon-delimited version segment.
  • If the id has no colon, mutate the request body in-place to append ':0' to the id value.
  • Leave the rest of the SchemaCreateRequest handling (sendMessage and response behavior) unchanged.
web/datafed-ws.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Consider guarding the new logic with a type check (e.g., typeof a_req.body.id === 'string') to avoid runtime errors if id is not a string.
  • If a_req.body is reused downstream (e.g., for logging or other handlers), you may want to avoid mutating it directly and instead construct a new payload with the normalized id when calling sendMessage.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider guarding the new logic with a type check (e.g., `typeof a_req.body.id === 'string'`) to avoid runtime errors if `id` is not a string.
- If `a_req.body` is reused downstream (e.g., for logging or other handlers), you may want to avoid mutating it directly and instead construct a new payload with the normalized `id` when calling `sendMessage`.

## Individual Comments

### Comment 1
<location path="web/datafed-ws.js" line_range="1887" />
<code_context>

 app.post("/api/sch/create", (a_req, a_resp) => {
+    // Mirror Python CommandLib: ensure :0 version suffix on create
+    if (a_req.body.id && a_req.body.id.indexOf(":") === -1) {
+        a_req.body.id = a_req.body.id + ":0";
+    }
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard against non-string `id` values before calling `.indexOf` to avoid runtime errors.

If `a_req.body.id` might be non-string (e.g., numeric from the client), `.indexOf` will throw. You can narrow to strings to avoid that:

```js
if (typeof a_req.body.id === "string" && a_req.body.id.indexOf(":") === -1) {
  a_req.body.id = a_req.body.id + ":0";
}
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread web/datafed-ws.js

app.post("/api/sch/create", (a_req, a_resp) => {
// Mirror Python CommandLib: ensure :0 version suffix on create
if (a_req.body.id && a_req.body.id.indexOf(":") === -1) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Guard against non-string id values before calling .indexOf to avoid runtime errors.

If a_req.body.id might be non-string (e.g., numeric from the client), .indexOf will throw. You can narrow to strings to avoid that:

if (typeof a_req.body.id === "string" && a_req.body.id.indexOf(":") === -1) {
  a_req.body.id = a_req.body.id + ":0";
}

@JoshuaSBrown JoshuaSBrown merged commit 117150c into master Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants