Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dockerfiles/course-discovery.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ EXPOSE 8381

FROM app AS prod

ENV DJANGO_SETTINGS_MODULE "course_discovery.settings.production"
ARG OPENEDX_TRANSLATIONS_REPO
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The OPENEDX_TRANSLATIONS_REPO build argument lacks a default value. This will cause build failures if the argument is not explicitly provided. Looking at edx-platform.Dockerfile line 25, a default value like "edx/openedx-translations" is used. Consider adding a default value to maintain consistency with other services and ensure builds work without requiring this argument to be explicitly passed.

Copilot uses AI. Check for mistakes.

ENV DJANGO_SETTINGS_MODULE="course_discovery.settings.production"
ENV ATLAS_OPTIONS="--repository=$OPENEDX_TRANSLATIONS_REPO"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The ATLAS_OPTIONS environment variable is being set with a reference to $OPENEDX_TRANSLATIONS_REPO, but this build argument may be undefined if not passed during build time. This could result in ATLAS_OPTIONS="--repository=" (empty repository value), which would cause the pull_translations command at line 86 to fail or use incorrect settings. The ARG should have a default value to prevent this issue.

Copilot uses AI. Check for mistakes.

RUN pip install -r ${DISCOVERY_CODE_DIR}/requirements/production.txt

Expand All @@ -86,9 +89,12 @@ CMD gunicorn --bind=0.0.0.0:8381 --workers 2 --max-requests=1000 -c course_disco

FROM app AS dev

ARG OPENEDX_TRANSLATIONS_REPO
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The OPENEDX_TRANSLATIONS_REPO build argument lacks a default value. This will cause build failures if the argument is not explicitly provided. Looking at edx-platform.Dockerfile line 25, a default value like "edx/openedx-translations" is used. Consider adding a default value to maintain consistency with other services and ensure builds work without requiring this argument to be explicitly passed.

Copilot uses AI. Check for mistakes.

RUN curl -L -o ${DISCOVERY_CODE_DIR}/course_discovery/settings/devstack.py https://raw.githubusercontent.com/edx/devstack/master/py_configuration_files/course_discovery.py

ENV DJANGO_SETTINGS_MODULE "course_discovery.settings.devstack"
ENV DJANGO_SETTINGS_MODULE="course_discovery.settings.devstack"
ENV ATLAS_OPTIONS="--repository=$OPENEDX_TRANSLATIONS_REPO"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The ATLAS_OPTIONS environment variable is being set with a reference to $OPENEDX_TRANSLATIONS_REPO, but this build argument may be undefined if not passed during build time. This could result in ATLAS_OPTIONS="--repository=" (empty repository value), which would cause the pull_translations command at line 102 to fail or use incorrect settings. The ARG should have a default value to prevent this issue.

Copilot uses AI. Check for mistakes.

RUN pip install -r ${DISCOVERY_CODE_DIR}/requirements/django.txt
RUN pip install -r ${DISCOVERY_CODE_DIR}/requirements/local.txt
Expand Down
12 changes: 10 additions & 2 deletions dockerfiles/credentials.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# SecretsUsedInArgOrEnv check gets false positives on the name CREDENTIALS
FROM ubuntu:jammy AS base

ARG OPENEDX_TRANSLATIONS_REPO
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The OPENEDX_TRANSLATIONS_REPO build argument lacks a default value. This will cause build failures if the argument is not explicitly provided. Looking at edx-platform.Dockerfile line 25, a default value like "edx/openedx-translations" is used. Consider adding a default value to maintain consistency with other services and ensure builds work without requiring this argument to be explicitly passed.

Suggested change
ARG OPENEDX_TRANSLATIONS_REPO
ARG OPENEDX_TRANSLATIONS_REPO=edx/openedx-translations

Copilot uses AI. Check for mistakes.
ARG CREDENTIALS_SERVICE_REPO=openedx/credentials
ARG CREDENTIALS_SERVICE_VERSION=master
ARG PYTHON_VERSION=3.12
ENV TZ=UTC
ENV TERM=xterm-256color
ENV DEBIAN_FRONTEND=noninteractive
ENV ATLAS_OPTIONS="--repository=$OPENEDX_TRANSLATIONS_REPO"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The ATLAS_OPTIONS environment variable is being set with a reference to $OPENEDX_TRANSLATIONS_REPO, but this build argument may be undefined if not passed during build time. This could result in ATLAS_OPTIONS="--repository=" (empty repository value), which would cause the pull_translations command at line 114 to fail or use incorrect settings. The ENV directive should be moved after the repository code is cloned, or the ARG should have a default value.

Copilot uses AI. Check for mistakes.

# software-properties-common is needed to setup our Python 3.12 env
RUN apt-get update && \
Expand Down Expand Up @@ -108,12 +110,15 @@ RUN mkdir -p /edx/var/log
# Cloning git repo. This line is after the python requirements so that changes to the code will not bust the image cache
ADD https://github.com/${CREDENTIALS_SERVICE_REPO}.git#${CREDENTIALS_SERVICE_VERSION} /edx/app/credentials/credentials

# Fetch the translations into the image once the Makefile is in place
RUN make pull_translations

# Install frontend dependencies in node_modules directory
RUN npm install --no-save
ENV NODE_BIN=/edx/app/credentials/credentials/node_modules
ENV PATH="$NODE_BIN/.bin:$PATH"
# Run webpack
RUN webpack --config webpack.config.js
# make static, which also runs webpack
RUN make static

# Change static folder owner to application user.
RUN chown -R app:app /edx/app/credentials/credentials/credentials/static
Expand All @@ -128,9 +133,12 @@ CMD gunicorn --workers=2 --name credentials -c /edx/app/credentials/credentials/
FROM base AS dev
USER root

ARG OPENEDX_TRANSLATIONS_REPO

RUN curl -L -o credentials/settings/devstack.py https://raw.githubusercontent.com/edx/devstack/${CREDENTIALS_SERVICE_VERSION}/py_configuration_files/credentials.py

ENV DJANGO_SETTINGS_MODULE=credentials.settings.devstack
ENV ATLAS_OPTIONS="--repository=$OPENEDX_TRANSLATIONS_REPO"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The ATLAS_OPTIONS environment variable is being set with a reference to $OPENEDX_TRANSLATIONS_REPO, but this build argument may be undefined if not passed during build time. This could result in ATLAS_OPTIONS="--repository=" (empty repository value), which would cause the pull_translations command at line 143 to fail or use incorrect settings. The ARG should have a default value to prevent this issue.

Copilot uses AI. Check for mistakes.
RUN pip install -r /edx/app/credentials/credentials/requirements/dev.txt
RUN make pull_translations

Expand Down