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/monitor data status #83

Merged
merged 5 commits into from
May 8, 2024
Merged

Feat/monitor data status #83

merged 5 commits into from
May 8, 2024

Conversation

anngvu
Copy link
Contributor

@anngvu anngvu commented May 6, 2024

Close #75.

Based on that initial bot suggestion, which was a good start but needed these revisions after analysis and/or testing:

Script:

  • Use auth token correctly
  • More efficient query where server can do most of the work/pull less data
  • Should not use query for annotations of experimentData because files can be uploaded but not annotated --
    for this, it doesn't matter if files are annotated, really just need to check if data files exist in the project.
  • Filter out Data Sharing Plans via creator heuristics.
  • Add syn.get, revise syn.store syntax
  • Add CLI flags
  • Add tests

Workflow:

  • Write to be run in service catalog, add Dockerfile.

@anngvu anngvu requested a review from allaway May 6, 2024 15:41
Copy link
Contributor

@allaway allaway left a comment

Choose a reason for hiding this comment

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

LGTM - I had one suggestion but it's not a blocker for merging!

# We'll need to filter out files created by nf-osi service or staff
# who tend to upload data sharing plans & other administrative files
print(f"Checking production table for {len(ids)} projects with status 'Data Pending'...")
fileview_df = syn.tableQuery(f"SELECT projectId,count(*) as N FROM {FILE_VIEW_ID} WHERE type='file' and createdBy not in ('3421893', '3459953', '3434950', '3342573') and projectId in {QUERY_IDS} group by projectId").asDataFrame()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fileview_df = syn.tableQuery(f"SELECT projectId,count(*) as N FROM {FILE_VIEW_ID} WHERE type='file' and createdBy not in ('3421893', '3459953', '3434950', '3342573') and projectId in {QUERY_IDS} group by projectId").asDataFrame()
fileview_df = syn.tableQuery(f"SELECT projectId,count(*) as N FROM {FILE_VIEW_ID} WHERE type='file' and createdBy not in ('3421893', '3459953', '3434950', '3342573') and projectId in {QUERY_IDS} group by projectId").asDataFrame()

Should we maintain a table on the portal backend project to keep the createdBy principal ids in? Then we could also use that table for reporting (instead of the one listed in the readme here https://github.com/nf-osi/internal-reports)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we probably need to start a table as a source of truth for who should be excluded for these sorts of things. I think we can do that first and then go back to revise these two + others.

@anngvu anngvu merged commit c1a1059 into main May 8, 2024
2 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.

Monitoring for dataStatus changes from "Data Pending" to "Under Embargo"
2 participants