Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

core: HTTP Trigger URLs #2970

Merged
merged 31 commits into from
Feb 7, 2022
Merged

core: HTTP Trigger URLs #2970

merged 31 commits into from
Feb 7, 2022

Conversation

briancain
Copy link
Member

@briancain briancain commented Feb 1, 2022

This pull request introduces a new endpoint into Waypoint server for
running Trigger URLs. By request, a user can concurrently stream back
job event stream output through HTTP. It does not allow un-authenticated
triggers to stream back the job event stream, and returns an HTTP 204 No Content.

Fixes #2987

@briancain briancain added the pr/no-changelog No automatic changelog entry required for this pull request label Feb 1, 2022
@briancain briancain requested a review from a team February 1, 2022 23:04
@briancain briancain removed the pr/no-changelog No automatic changelog entry required for this pull request label Feb 1, 2022
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

Looks good so far, just minor nits I've found.

internal/cli/trigger_apply.go Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
internal/server/httpapi/trigger.go Outdated Show resolved Hide resolved
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

👍

This commit updates the run trigger http func to stream all job output
that's running concurrently back to the requester.
Otherwise, we return an HTTP 204 No Content for initiated triggers
with no auth.
This commit updates the crafted message format that is streamed back to
the user. Now we return a value and valueType, where value is an
interface that is the direct terminal event value, and the valueType is
the type of terminal stream event.

Update stream message example in trigger docs
This commit moves a few extra nested levels of code out for code
readability. Functionally it operates the same.
Always respect a cancelled context, otherwise we could spin waiting for
the next message and ignore a cancel request
@briancain
Copy link
Member Author

Force pushed to fix a proto merge conflict off main

@briancain briancain merged commit 58f0608 into main Feb 7, 2022
@briancain briancain deleted the feat/core/http-trigger-urls branch February 7, 2022 19:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP Trigger URLs
3 participants