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

Mrc 5585 submit endpoint #6

Merged
merged 21 commits into from
Aug 16, 2024
Merged

Mrc 5585 submit endpoint #6

merged 21 commits into from
Aug 16, 2024

Conversation

M-Kusumgar
Copy link
Contributor

@M-Kusumgar M-Kusumgar commented Aug 1, 2024

The implementation of the submit function was done in #5, this is wrapping that up in an endpoint and exposing it. Main changes include:

  • starting a queue and adding it to state on api creation (unsure about this decision, we could equally create new queue objects everytime, and give it the queue_id but this seemed nice as it is in state)
  • submit_report_run endpoint
  • documentation for functions/args
  • schemas
  • e2e with full setup

@M-Kusumgar M-Kusumgar requested a review from richfitz August 5, 2024 08:55
@@ -28,5 +28,15 @@
porcelain::porcelain_state(root = state$root),
returning = porcelain::porcelain_returning_json("report_parameters"),
validate = validate)
},
"POST /report/run" = function(state, validate) {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps copy in this file: https://github.com/jameel-institute/daedalus.api/blob/main/.gitattributes

and you'll get nicer rendering of diffs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooo nice

Comment on lines 19 to 20
"properties": {},
"additionalProperties": true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"properties": {},
"additionalProperties": true
"additionalProperties": {
"type": ["boolean", "integer", "number", "string"]
}

we can be stricter here, and the properties key does nothing in the current version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"type": "string"
}
},
"required": ["job_id"],
Copy link
Member

Choose a reason for hiding this comment

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

any reason not to return as a string rather than an object? if an object any reason not to use jobId as that's probably closer to what Packit uses? And any reason we can't use task not job as that's what rrq uses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason other than i was speculating that we may want to add other things that return from this endpoint, and having an object returned means an easier future refactor in kotlin if another field is needed

yep this can definitely be camelcase

job_id was only used because I believe the sequence diagram uses job id and that percolated through to the tickets, i can change it to task!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have changed to taskId

@@ -1,3 +1,3 @@
orderly2::orderly_artefact("Some data", "data.rds")
orderly2::orderly_artefact(description = "Some data", "data.rds")
Copy link
Member

Choose a reason for hiding this comment

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

sorry, this is for the greater good...

Comment on lines +8 to +13
"branch": {
"type": "string"
},
"hash": {
"type": "string"
},
Copy link
Member

Choose a reason for hiding this comment

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

why do we have both branch and hash, and not ref? Probably this is a good idea though tbh

What is the interpretation of branch names? Do we add main/ to them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the runner checks out to that branch and resets head to the hash, we would have a different behaviour if we used a ref right? would we not get a detached head if someone specified just a hash

there will be some extra work in the UI if we want people to be able to specify a commit hash on a branch instead of just a commit hash but that can come later

branch names are just what we do a git checkout to before resetting to the specified hash, im not sure what you mean by adding main/ to them but we dont do anything like that, just pass branchname into git checkout via gert

@M-Kusumgar M-Kusumgar requested a review from richfitz August 16, 2024 12:04
@M-Kusumgar M-Kusumgar merged commit c937d3a into main Aug 16, 2024
7 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.

2 participants