Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: instant job event notifications #24

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

michaeladler
Copy link
Member

@michaeladler michaeladler commented Jun 22, 2023

Description

This commit introduces a more efficient mechanism for notifications
related to job events, such as creation, updating, and deletion. Unlike
the previous architecture where clients had to constantly poll the
server for updates, the new implementation uses server-sent events (SSE)
to allow client to receive updates from the server , improving
efficiency and reducing network overhead.

Key Features:

  • Introduced a new SSE-enabled endpoint, /jobs/events, which accepts
    filter parameters to customize the stream of events received.
  • Clients can subscribe to /jobs/events for to receive updates on job
    events that meet specified filter criteria.
  • Provided a client reference implementation through wfxctl.

Issues Addressed

Closes #11

Change Type

Please select the relevant options:

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the CONTRIBUTING document.
  • My changes adhere to the established code style, patterns, and best practices.
  • I have added tests that demonstrate the effectiveness of my changes.
  • I have updated the documentation accordingly (if applicable).
  • I have added an entry in the CHANGELOG to document my changes (if applicable).

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Attention: 69 lines in your changes are missing coverage. Please review.

Comparison is base (b3ea178) 79.82% compared to head (7ae90b7) 79.85%.
Report is 3 commits behind head on main.

Files Patch % Lines
cmd/wfxctl/cmd/job/events/events.go 62.33% 22 Missing and 7 partials ⚠️
internal/producer/text_event_stream.go 25.00% 8 Missing and 4 partials ⚠️
middleware/responder/sse/responder.go 82.92% 6 Missing and 1 partial ⚠️
api/northbound.go 77.77% 4 Missing and 2 partials ⚠️
api/southbound.go 77.77% 4 Missing and 2 partials ⚠️
internal/handler/job/events/events.go 92.00% 4 Missing and 2 partials ⚠️
middleware/responder/util/content_type.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
+ Coverage   79.82%   79.85%   +0.03%     
==========================================
  Files          80       85       +5     
  Lines        3033     3376     +343     
==========================================
+ Hits         2421     2696     +275     
- Misses        443      492      +49     
- Partials      169      188      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaeladler michaeladler added the enhancement New feature or request label Jun 22, 2023
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 6 times, most recently from 2a40208 to e8caa57 Compare June 23, 2023 12:08
@michaeladler michaeladler marked this pull request as ready for review June 23, 2023 12:08
@michaeladler michaeladler requested a review from stormc as a code owner June 23, 2023 12:08
@michaeladler michaeladler marked this pull request as draft June 23, 2023 12:29
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from e8caa57 to 11498fb Compare June 23, 2023 13:56
@michaeladler michaeladler changed the title feat: introduce real-time job update notifications via SSE feat: introduce instant job update notifications via SSE Jun 23, 2023
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from 11498fb to d15fa3a Compare June 23, 2023 14:04
@michaeladler michaeladler marked this pull request as ready for review June 23, 2023 14:05
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 10 times, most recently from 18c9db7 to f7780c1 Compare June 30, 2023 18:56
@michaeladler michaeladler marked this pull request as draft July 3, 2023 15:08
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 2 times, most recently from a3abf39 to e21e837 Compare July 4, 2023 10:14
@michaeladler michaeladler self-assigned this Jul 4, 2023
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 2 times, most recently from e59e165 to fbc1288 Compare October 25, 2023 11:22
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 4 times, most recently from ca6f043 to dea3000 Compare November 6, 2023 10:51
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from dea3000 to df60c30 Compare November 9, 2023 09:56
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch 2 times, most recently from 49e1945 to 5e83b40 Compare November 20, 2023 16:15
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from 5e83b40 to 51aefc6 Compare December 1, 2023 09:43
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from 51aefc6 to 3580cda Compare December 13, 2023 10:18
docs/operations.md Outdated Show resolved Hide resolved
docs/operations.md Outdated Show resolved Hide resolved
internal/handler/job/delete.go Outdated Show resolved Hide resolved
internal/handler/job/events/events.go Show resolved Hide resolved
This commit introduces a more efficient mechanism for notifications
related to job events, such as creation, updating, and deletion. Unlike
the previous architecture, where clients had to constantly poll the
server for updates, the new implementation uses server-sent events (SSE)
to allow clients to receive updates from the server, improving
efficiency and reducing network overhead.

Key Features:

- Introduced a new SSE-enabled endpoint, `/jobs/events`, which accepts
  filter parameters to customize the stream of events received.
- Clients can subscribe to `/jobs/events` to receive updates on job
  events that meet specified filter criteria.
- Provided a client reference implementation through `wfxctl`.

Signed-off-by: Michael Adler <[email protected]>
@michaeladler michaeladler force-pushed the 11-notify-clients-on-job-updates branch from 9a20072 to 7ae90b7 Compare December 13, 2023 14:31
@stormc stormc merged commit 976875f into siemens:main Dec 13, 2023
13 checks passed
@michaeladler michaeladler deleted the 11-notify-clients-on-job-updates branch January 10, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notify clients on job updates
2 participants