Skip to content

feat: add data-review/batch-initiate endpoint #165

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

Merged
merged 8 commits into from
Jan 7, 2025
Merged

Conversation

mariobuikhuizen
Copy link
Contributor

@mariobuikhuizen mariobuikhuizen commented Dec 11, 2024

Usage:

review_builder = nm.data_review_builder()
review_builder.add_integration(integration_rid)
review_builder.add_request(run_rid_1, checklist_rid_1, commit_1)
review_builder.add_request(run_rid_2, checklist_rid_2, commit_2)
reviews = review_builder.initiate()

for review in reviews:
    print(review)
    print(review.get_violations())

Output:

DataReview(
    rid='ri.scout.cerulean-staging.data-review.62ff2c3e-383b-432c-81a8-6df30cc6a7a6',
    run_rid='ri.scout.cerulean-staging.run.1480e4c0-afd9-4f1b-ada3-b0e06562599a',
    checklist_rid='ri.scout.cerulean-staging.check-collection.ad78d14c-32ed-4d90-9895-ca22cf256175',
    checklist_commit='f904f05a1114911c6bdbcee7c0e0ed03ff426f8c',
    completed=True
)

[
    CheckViolation(
        rid='ri.scout.cerulean-staging.check-alert.5a88afc8-9cdb-45a0-8358-aed4ddc620e5',
        check_rid='ri.scout.cerulean-staging.check.47e93a2f-5e6c-4e20-8007-b3d432f00b87',
        name='High Battery Load',
        start=1722648886000000000,
        end=1722648889000000000,
        priority=2
    ),
    CheckViolation(
        rid='ri.scout.cerulean-staging.check-alert.557c1a99-06d9-4c8a-abfb-59a6648f6639',
        check_rid='ri.scout.cerulean-staging.check.47e93a2f-5e6c-4e20-8007-b3d432f00b87',
        name='High Battery Load',
        start=1722648840000000000,
        end=1722648841000000000,
        priority=2
    ),
   ...
]

@najork najork self-requested a review December 18, 2024 23:33
@mariobuikhuizen mariobuikhuizen marked this pull request as ready for review December 19, 2024 22:30
@jackparmer
Copy link
Contributor

@mariobuikhuizen so close! can you please link a corresponding PR for a "Data review" docs page for this?

Please mirror the structure for the no-code docs:
image

Copy link
Contributor

@jackparmer jackparmer left a comment

Choose a reason for hiding this comment

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

Just needs a docs PR:

image

@jackparmer jackparmer merged commit 3e659f5 into main Jan 7, 2025
5 checks passed
@jackparmer jackparmer deleted the feat_data_review branch January 7, 2025 22:19
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.

4 participants