Skip to content

Use new API to reference programs and connectors#1157

Merged
Karakatiza666 merged 1 commit intonames-as-refsfrom
names-as-refs-ui
Dec 19, 2023
Merged

Use new API to reference programs and connectors#1157
Karakatiza666 merged 1 commit intonames-as-refsfrom
names-as-refs-ui

Conversation

@Karakatiza666
Copy link
Copy Markdown
Contributor

Change UI to reference programs and connectors by name when managing pipelines

@Karakatiza666 Karakatiza666 added Web Console Related to the browser based UI API Distributed system APIs javascript Pull requests that update Javascript code labels Dec 18, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 18, 2023

🤖 Meticulous replayed 14 user sessions and took 6 visual snapshots. Meticulous did not run on names-as-refs of the names-as-refs branch and so there was nothing to compare against.

Please merge your pull request for setting up Meticulous in CI and ensure that it’s running on push events to the names-as-refs branch.

Last updated for commit 5340f99. This comment will update as new commits are pushed.

Copy link
Copy Markdown
Contributor

@lalithsuresh lalithsuresh left a comment

Choose a reason for hiding this comment

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

LGTM. Let's merge tomorrow after the WebConsole test framework is ready.

// could cancel potentially in-progress saves (started by client action).

const project = projectsQuery.data.find(p => p.program_id === descriptor.program_id)
const project = projectsQuery.data.find(p => p.name === descriptor.program_name)
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.

why not call both of them "program_name"?
Then you don't have to think

// programCode: (programName: string) => ProgramsService.getProgram(programName, true), // TODO: Uncomment with an API update
programCode: (programName: string) =>
ProgramsService.getPrograms(undefined, programName, true).then(p =>
p.length ? p[0] : Promise.reject(new Error('/v0/programs: ' + programName + ' not found'))
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.

Why the /v0? Who consumes this error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In a previous implementation when programCode with a given programId was not found (should be super rare) an error was not handled, so it would bubble up (and shown in a bottom left red error popup, i think). Here I am manually throwing an error to keep this behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The error message is not 1 to 1 to previous one, just did a simple reasonable one

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.

But why the "/v0/programs" is part of the error?

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.

This "v0" is an internal thing that no one needs to know about. I don't think it should be part of the error message

Copy link
Copy Markdown
Contributor

@lalithsuresh lalithsuresh Dec 18, 2023

Choose a reason for hiding this comment

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

/v0/programs is the REST API endpoint. I agree with Mihai that we probably don't need "/v0/programs" in the error message string. It also feels redundant with the error the API server will give back anyway when accessing programs that don't exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lalithsuresh will api return 4XX if /v0/programs?name=... doesn't find a program? I assumed it would return empty list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Upd: It does return 4xx. Patched the custom error out

…pipelines

Signed-off-by: George <bulakh.96@gmail.com>
@Karakatiza666 Karakatiza666 merged commit aaf558e into names-as-refs Dec 19, 2023
@Karakatiza666 Karakatiza666 deleted the names-as-refs-ui branch December 19, 2023 22:26
@lalithsuresh lalithsuresh restored the names-as-refs-ui branch December 23, 2023 00:38
@lalithsuresh lalithsuresh deleted the names-as-refs-ui branch December 23, 2023 00:39
gz added a commit that referenced this pull request Apr 11, 2026
…eConfig

DevTweaks Option<f64> fields (bloom_false_positive_rate, balancer_balance_tax,
etc.) fail to deserialize when nested inside PipelineConfig, which uses
#[serde(flatten)] on RuntimeConfig. This is a known serde_json bug (#1157)
triggered by the workspace-wide arbitrary_precision feature: the Content
buffer represents numbers as maps, producing "invalid type: map, expected f64".

Apply the existing serde_via_value::deserialize workaround (already used by
ResourceConfig.cpu_cores_min/max) to all four Option<f64> fields in DevTweaks.

Also add the chrono "alloc" feature to fix a pre-existing compile error in
adapter_stats.rs (to_rfc3339_opts returns String, which requires alloc).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Distributed system APIs javascript Pull requests that update Javascript code Web Console Related to the browser based UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants