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

[ENH] Add -u flag to dataget instruction #435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[ENH] Add -u flag to dataget instruction #435

wants to merge 1 commit into from

Conversation

surchs
Copy link
Contributor

@surchs surchs commented Jan 11, 2025

This will help ensure dataget runs as the
current user

Changes proposed in this pull request:

NOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the bump version workflow run

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass
  • If the PR changes the participant-level and/or the dataset-level result file, the query-tool-results files in the neurobagel_examples repo have been regenerated

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Enhancements:

  • Ensure downloaded data is owned by the current user.

This will help ensure dataget runs as the
current user
Copy link

sourcery-ai bot commented Jan 11, 2025

Reviewer's Guide by Sourcery

This pull request adds the -u flag to the docker run command used by the dataget instruction. This flag sets the user and group ID of the container to match the current user, ensuring that downloaded files are owned by the current user and not root. This change addresses permission issues that could arise when running dataget as a non-root user.

Sequence diagram for dataget command execution with user permissions

sequenceDiagram
    participant User as User
    participant Docker as Docker Container
    participant FS as File System

    User->>Docker: Run dataget with -u $(id -u):$(id -g)
    Note over Docker: Container runs with user's UID/GID
    Docker->>FS: Create output directory
    Docker->>FS: Download and write data
    Note over FS: Files owned by user's UID/GID
    FS-->>User: Access downloaded files with correct permissions
Loading

File-Level Changes

Change Details Files
Added the -u flag to the docker run command to ensure the container runs with the user's UID/GID.
  • Added -u $(id -u):$(id -g) to the docker run command.
  • Added an explanation to the help text about the -u flag and its purpose to clarify the change for users.
  • Updated the path to the query results file in the docker run command from neurobagel-query-results-with-URIs.tsv to neurobagel-query-results.tsv
src/components/GetDataDialog.tsx

Assessment against linked issues

Issue Objective Addressed Explanation
#431 Include -u flag to change user to current user in the docker run command
#431 Update the docker run command to use the correct input file name
#431 Add a note explaining the purpose of the -u flag

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

netlify bot commented Jan 11, 2025

Deploy Preview for neurobagel-query ready!

Name Link
🔨 Latest commit 2f6fe43
🔍 Latest deploy log https://app.netlify.com/sites/neurobagel-query/deploys/6781cd151ab87d000859cd1b
😎 Deploy Preview https://deploy-preview-435--neurobagel-query.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@surchs surchs added the pr-documentation Change that only affects user documentation label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-documentation Change that only affects user documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update code snippet for dataget
1 participant