Skip to content

[management] Implement Job API with Validation, Persistence, and Bundle Job Support#4418

Merged
aliamerj merged 1 commit intofeature/remote-debugfrom
debug-api-recover
Aug 29, 2025
Merged

[management] Implement Job API with Validation, Persistence, and Bundle Job Support#4418
aliamerj merged 1 commit intofeature/remote-debugfrom
debug-api-recover

Conversation

@aliamerj
Copy link
Copy Markdown
Contributor

@aliamerj aliamerj commented Aug 29, 2025

Describe your changes

Implemented the API for job operations, including creating new jobs, fetching jobs by peer, and fetching individual job details. Added support for bundle/debug jobs with fully validated parameters (e.g., bundle_for_time, log_file_count, anonymize) and ensured that pending jobs are handled correctly.

Temporary permissions are based on the existing “delete peers” permission to allow job operations, with a TODO to implement a dedicated permission for creating and fetching jobs. Also added TODOs to integrate with the job channel once it is ready #4367

All job data is persisted in the database, including account ID, peer ID, job type, status, parameters, and results. Jobs are validated before creation to prevent invalid payloads.

Issue ticket number and link #4354

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

fix lint

clean up

fix MarkPendingJobsAsFailed

apply feedbacks 1

fix typo

change api and apply new schema

fix lint

fix api object

clean switch case

apply feedback 2

fix error handle in create job

get rid of any/interface type in job database

fix sonar issue

use RawJson for both parameters and results

running go mod tidy

update package

fix 1

update codegen

fix code-gen

fix snyk

fix snyk hopefully
@sonarqubecloud
Copy link
Copy Markdown

@aliamerj aliamerj merged commit 3f6d955 into feature/remote-debug Aug 29, 2025
36 of 37 checks passed
@aliamerj aliamerj deleted the debug-api-recover branch August 29, 2025 15:00
aliamerj added a commit that referenced this pull request Sep 30, 2025
fix lint

clean up

fix MarkPendingJobsAsFailed

apply feedbacks 1

fix typo

change api and apply new schema

fix lint

fix api object

clean switch case

apply feedback 2

fix error handle in create job

get rid of any/interface type in job database

fix sonar issue

use RawJson for both parameters and results

running go mod tidy

update package

fix 1

update codegen

fix code-gen

fix snyk

fix snyk hopefully
aliamerj added a commit that referenced this pull request Oct 6, 2025
fix lint

clean up

fix MarkPendingJobsAsFailed

apply feedbacks 1

fix typo

change api and apply new schema

fix lint

fix api object

clean switch case

apply feedback 2

fix error handle in create job

get rid of any/interface type in job database

fix sonar issue

use RawJson for both parameters and results

running go mod tidy

update package

fix 1

update codegen

fix code-gen

fix snyk

fix snyk hopefully
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.

2 participants