Skip to content

Conversation

@ruivieira
Copy link
Member

@ruivieira ruivieira commented Oct 5, 2025

What does this PR do?

  • Temporarily use FMS test/0.2.3 to bring AdapterSpec changes until 0.2.3 is published
  • Temporarily fix Garak's folder permissions

Summary by Sourcery

Temporarily pin trustyai_fms dependency to version 0.2.3 on the Test PyPI index and apply Garak provider folder permission fixes

Bug Fixes:

  • Adjust ownership and permissions for Garak provider scan, config, and cache directories

Enhancements:

  • Pin trustyai_fms to version 0.2.3 using the Test PyPI index in build script, Containerfile, and build.yaml

@ruivieira ruivieira self-assigned this Oct 5, 2025
@ruivieira ruivieira added the bug Something isn't working label Oct 5, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 5, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR temporarily routes the trustyai_fms dependency to the Test PyPI index for version 0.2.3 in both build scripts and container definitions, and adds directory creation and permission adjustments for the Garak provider to ensure writable scan locations.

Class diagram for Garak provider directory and permission changes

classDiagram
    class ContainerBuild {
        +install_fms(version)
        +install_garak(version)
        +create_garak_scan_dirs()
        +set_garak_permissions()
    }
    class GarakProvider {
        +_scan_files: Directory
        +.config/garak: Directory
        +.local/share/garak: Directory
        +.cache/garak/resources: Directory
        +permissions: rwx
    }
    ContainerBuild --> GarakProvider: manages directories and permissions
Loading

File-Level Changes

Change Details Files
Pin trustyai_fms dependency to version 0.2.3 via Test PyPI index
  • Inject extra-index-url replacement logic in dependency builder
  • Update Containerfile pip install command to use test PyPI for 0.2.3
  • Bump trustyai_fms module version in build configuration
trustyai-distribution/build.py
trustyai-distribution/Containerfile
trustyai-distribution/build.yaml
Add and fix Garak provider directory permissions
  • Create scan files directory under Garak package and chown to non-root user
  • Make Garak config, share, and cache directories and set world-writable permissions
  • Adjust ownership of application work directories for Garak logs
trustyai-distribution/Containerfile

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. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the 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 exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `trustyai-distribution/Containerfile:63` </location>
<code_context>
+    chown -R 1001:1001 /opt/app-root/lib64/python3.12/site-packages/llama_stack_provider_trustyai_garak
+# Create Garak directories with full permissions (world-writable for debugging)
+RUN mkdir -p ${APP_ROOT}/src/.config/garak ${APP_ROOT}/src/.local/share/garak ${APP_ROOT}/src/.cache/garak/resources && \
+    chmod -R 777 ${APP_ROOT}/src/.config ${APP_ROOT}/src/.local ${APP_ROOT}/src/.cache && \
+    chown -R 1001:0 ${APP_ROOT}/src/.config ${APP_ROOT}/src/.local ${APP_ROOT}/src/.cache
 # Switch back to non-root user
</code_context>

<issue_to_address>
**🚨 issue (security):** World-writable permissions (chmod 777) may introduce security risks.

Restrict permissions to only those required for debugging, and ensure more secure settings are used before deploying to production.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

chown -R 1001:1001 /opt/app-root/lib64/python3.12/site-packages/llama_stack_provider_trustyai_garak
# Create Garak directories with full permissions (world-writable for debugging)
RUN mkdir -p ${APP_ROOT}/src/.config/garak ${APP_ROOT}/src/.local/share/garak ${APP_ROOT}/src/.cache/garak/resources && \
chmod -R 777 ${APP_ROOT}/src/.config ${APP_ROOT}/src/.local ${APP_ROOT}/src/.cache && \
Copy link

Choose a reason for hiding this comment

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

🚨 issue (security): World-writable permissions (chmod 777) may introduce security risks.

Restrict permissions to only those required for debugging, and ensure more secure settings are used before deploying to production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants