Skip to content

Rename CRITERIA_ASSETS_* to EXTERNAL_ASSETS_*#320

Merged
ArthurCRodrigues merged 1 commit into
mainfrom
301-rename-criteria_assets-to-external_assets
May 16, 2026
Merged

Rename CRITERIA_ASSETS_* to EXTERNAL_ASSETS_*#320
ArthurCRodrigues merged 1 commit into
mainfrom
301-rename-criteria_assets-to-external_assets

Conversation

@matheusmra

@matheusmra matheusmra commented May 16, 2026

Copy link
Copy Markdown
Member

Context

Solution

Replace CRITERIA_ASSETS_* environment variables with EXTERNAL_ASSETS_* across the codebase and docs. Updated .env.example, docker-compose.yml, autograder/services/assets/resolver.py (in-memory cache env var), autograder/services/assets/s3_provider.py (bucket name env var), and docs/features/setup_config_feature.md.
Make sure to update deployment and local environment variables to the new names to avoid configuration breakage.

Further clarifications

Related issues

#301

Checklist

  • I linked the related issue(s) and explained the motivation.
  • I kept this PR focused and scoped to a single concern.
  • I added or updated tests for changed behavior (or explained why not needed).
  • I ran the relevant tests locally.
  • I updated documentation when needed (README/docs/API examples).
  • This PR introduces API contract changes (request/response/endpoint/DTO).
  • If API changed, I documented compatibility or migration notes.
  • This PR includes breaking changes.
  • If breaking, I clearly described impact and migration steps.

Replace CRITERIA_ASSETS_* environment variables with EXTERNAL_ASSETS_* across the codebase and docs. Updated .env.example, docker-compose.yml, autograder/services/assets/resolver.py (in-memory cache env var), autograder/services/assets/s3_provider.py (bucket name env var), and docs/features/setup_config_feature.md. Make sure to update deployment and local environment variables to the new names to avoid configuration breakage.
Copilot AI review requested due to automatic review settings May 16, 2026 12:47
@matheusmra matheusmra linked an issue May 16, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR renames the external asset injection environment variables from the legacy CRITERIA_ASSETS_* names to EXTERNAL_ASSETS_* across the autograder runtime configuration and documentation, aligning terminology with the “external assets” feature.

Changes:

  • Renamed S3 bucket env var to EXTERNAL_ASSETS_BUCKET_NAME in code, docker-compose.yml, .env.example, and docs.
  • Renamed in-memory asset cache limit env var to EXTERNAL_ASSETS_IN_MEMORY_CACHE_LIMIT in the asset resolver and .env.example.
  • Updated setup-config feature documentation to reflect the new naming.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/features/setup_config_feature.md Updates documented env var name(s) for S3-backed asset injection.
docker-compose.yml Updates the dev compose environment variable name for the assets bucket.
autograder/services/assets/s3_provider.py Switches bucket name lookup to EXTERNAL_ASSETS_BUCKET_NAME.
autograder/services/assets/resolver.py Switches cache limit lookup to EXTERNAL_ASSETS_IN_MEMORY_CACHE_LIMIT.
.env.example Updates example env var names to the new EXTERNAL_ASSETS_* scheme.
Comments suppressed due to low confidence (1)

autograder/services/assets/s3_provider.py:20

  • S3AssetProvider now only reads EXTERNAL_ASSETS_BUCKET_NAME. This makes existing deployments that still set CRITERIA_ASSETS_BUCKET_NAME fail at runtime (bucket_name becomes None), and the resulting error will be a generic S3 fetch failure. Consider reading the new env var first but falling back to the old name with a deprecation warning, and/or explicitly validating bucket_name during initialization to raise a clear configuration error mentioning the expected env var(s).
        # Environment variables
        self.bucket_name = os.getenv("EXTERNAL_ASSETS_BUCKET_NAME")
        self.access_key = os.getenv("AWS_ACCESS_KEY_ID") or os.getenv("AWS_ACCESS_ID")
        self.secret_key = os.getenv("AWS_SECRET_ACCESS_KEY")
        self.region = os.getenv("AWS_REGION", "us-east-1")
        self.endpoint_url = os.getenv("S3_ENDPOINT_URL")

Comment on lines 12 to 15
def __init__(self):
in_memory_limit = int(os.getenv("CRITERIA_ASSETS_IN_MEMORY_CACHE_LIMIT", "100"))
in_memory_limit = int(os.getenv("EXTERNAL_ASSETS_IN_MEMORY_CACHE_LIMIT", "100"))
self.cache_manager = AssetCacheManager(in_memory_limit=in_memory_limit)
self.provider = S3AssetProvider(self.cache_manager)
Comment on lines 12 to 15
def __init__(self):
in_memory_limit = int(os.getenv("CRITERIA_ASSETS_IN_MEMORY_CACHE_LIMIT", "100"))
in_memory_limit = int(os.getenv("EXTERNAL_ASSETS_IN_MEMORY_CACHE_LIMIT", "100"))
self.cache_manager = AssetCacheManager(in_memory_limit=in_memory_limit)
self.provider = S3AssetProvider(self.cache_manager)
Comment on lines 70 to 71
- `AWS_ACCESS_ID` & `AWS_SECRET_ACCESS_KEY`: Credentials for the S3 provider.

@ArthurCRodrigues ArthurCRodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll just fix our server's vars and this will be merged

@ArthurCRodrigues ArthurCRodrigues merged commit 7432548 into main May 16, 2026
7 checks passed
@ArthurCRodrigues ArthurCRodrigues deleted the 301-rename-criteria_assets-to-external_assets branch May 16, 2026 15:34
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.

Rename CRITERIA_ASSETS to EXTERNAL_ASSETS

3 participants