Skip to content
Open
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
2 changes: 1 addition & 1 deletion docker-compose-mktg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version: '3.3'
services:

mktg:
image: eu.gcr.io/openedx-231314/edraak/marketing:20250618-153829-m
image: eu.gcr.io/openedx-231314/edraak/marketing:20251001-113835-m
environment:
NODE_ENV: development
command: bash -c 'while true; do python manage.py runserver 0.0.0.0:8500 --settings=marketingsite.envs.dev; sleep 2; done'
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-progs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ version: '3.3'
services:

progs:
image: eu.gcr.io/openedx-231314/edraak/progs:20250618-155233-m
image: eu.gcr.io/openedx-231314/edraak/progs:20251001-113817-m
environment:
PROGS_CFG: /app/docker.json
NODE_ENV: development
command: bash -c 'while true; do python3.8 manage.py runserver 0.0.0.0:8800 --settings=edraakprograms.dev; sleep 2; done'
command: bash -c 'while true; do python manage.py runserver 0.0.0.0:8800 --settings=edraakprograms.dev; sleep 2; done'
container_name: edraak.devstack.programs
working_dir: /app
ports:
Expand Down
5 changes: 3 additions & 2 deletions provision-mktg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ echo "CREATE DATABASE IF NOT EXISTS marketingsite;" | docker exec -i edx.devstac

echo "** Marketing: Copy cacheed files to code dir **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'cp -Rn /cache/* /app/.'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'pip3 install -r requirements.txt'
echo "** Marketing: Install requirements **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'pip install -r requirements.txt'
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix unquoted backticks to prevent word splitting.

The Shellcheck warning SC2046 indicates that backticks should be quoted to prevent word splitting if DOCKER_COMPOSE_FILES contains spaces or special characters.

Apply this diff:

-echo "** Marketing: Install requirements **"
-docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'pip install -r requirements.txt'
+echo "** Marketing: Install requirements **"
+docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec mktg bash -c 'pip install -r requirements.txt'

Alternatively, if DOCKER_COMPOSE_FILES is a single value or already properly quoted, consider using it directly:

+docker compose ${DOCKER_COMPOSE_FILES} exec mktg bash -c 'pip install -r requirements.txt'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "** Marketing: Install requirements **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'pip install -r requirements.txt'
echo "** Marketing: Install requirements **"
docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec mktg bash -c 'pip install -r requirements.txt'
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 12-12: Quote this to prevent word splitting.

(SC2046)

🤖 Prompt for AI Agents
In provision-mktg.sh around lines 11-12, the command uses unquoted backticks
which can cause word splitting when DOCKER_COMPOSE_FILES contains spaces;
replace the backticked expansion with a quoted command substitution and quote
the variable, e.g. change `docker compose \`echo ${DOCKER_COMPOSE_FILES}\` exec
...` to use docker compose "$(echo "${DOCKER_COMPOSE_FILES}")" exec mktg bash -c
'pip install -r requirements.txt' or, if DOCKER_COMPOSE_FILES is a single
properly quoted value, use docker compose ${DOCKER_COMPOSE_FILES} exec ...
ensuring the variable is quoted as needed.


echo "** Marketing: Migrating databases **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'python3.8 manage.py migrate --settings=marketingsite.envs.dev'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'python manage.py migrate --settings=marketingsite.envs.dev'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix unquoted backticks to prevent word splitting.

The Shellcheck warning SC2046 indicates that backticks should be quoted to prevent word splitting if DOCKER_COMPOSE_FILES contains spaces or special characters.

Apply this diff:

-docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'python manage.py migrate --settings=marketingsite.envs.dev'
+docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec mktg bash -c 'python manage.py migrate --settings=marketingsite.envs.dev'

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 15-15: Quote this to prevent word splitting.

(SC2046)

🤖 Prompt for AI Agents
In provision-mktg.sh around line 15, the backticks around echo
${DOCKER_COMPOSE_FILES} are unquoted which can cause word splitting; replace the
backticks with a quoted command substitution and quote the variable: use "$(echo
"${DOCKER_COMPOSE_FILES}")" (i.e. change the command to use docker compose
"$(echo "${DOCKER_COMPOSE_FILES}")" exec mktg bash -c 'python manage.py migrate
--settings=marketingsite.envs.dev') so the expanded value is treated as a
single, safely quoted argument.


echo "** Marketing: Compiling assets **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec mktg bash -c 'rm -rf node_modules/'
Expand Down
6 changes: 3 additions & 3 deletions provision-progs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ echo "CREATE DATABASE IF NOT EXISTS edraakprograms;" | docker exec -i edx.devsta


echo "** Progs: Setting correct python version **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix unquoted backticks to prevent word splitting.

The Shellcheck warning SC2046 indicates that backticks should be quoted. Additionally, verify that the update-alternatives command is necessary in the provisioning script, or if it should be baked into the container image instead.

Apply this diff:

-docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1'
+docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1'
docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec progs bash -c 'update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1'
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 11-11: Quote this to prevent word splitting.

(SC2046)

🤖 Prompt for AI Agents
In provision-progs.sh around line 11, the use of unquoted backticks causes
shellword-splitting (SC2046); replace the backticks with a POSIX command
substitution and properly quote the variable (e.g., use "$(echo
"${DOCKER_COMPOSE_FILES}")" or simply "${DOCKER_COMPOSE_FILES}" if already
formatted) and wrap the inner bash -c string in double quotes so the
`update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1`
command is passed intact; also verify whether running update-alternatives here
is required or should instead be performed in the container image build and, if
so, move that step into the Dockerfile.


echo "** Progs: Copy cacheed files to code dir **"
#docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'cp -Rn /cache/* /app/.'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'pip3 install -r requirements.txt'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'pip install -r requirements.txt'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix unquoted backticks to prevent word splitting.

The Shellcheck warning SC2046 indicates that backticks should be quoted to prevent word splitting if DOCKER_COMPOSE_FILES contains spaces or special characters.

Apply this diff:

-docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'pip install -r requirements.txt'
+docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec progs bash -c 'pip install -r requirements.txt'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'pip install -r requirements.txt'
docker compose "$(echo ${DOCKER_COMPOSE_FILES})" exec progs bash -c 'pip install -r requirements.txt'
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 15-15: Quote this to prevent word splitting.

(SC2046)

🤖 Prompt for AI Agents
In provision-progs.sh around line 15, the command uses unquoted backticks which
can cause word splitting when DOCKER_COMPOSE_FILES contains spaces; replace the
backticks with a quoted command substitution and quote the variable, e.g. use
"$(echo "${DOCKER_COMPOSE_FILES}")" (or simply "${DOCKER_COMPOSE_FILES}" if
safe) so the expanded value is preserved as a single argument: update the line
to use quoted $(...) and quoted variable expansion.


echo "** Progs: Migrating databases **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'python3.8 manage.py migrate --settings=edraakprograms.dev'
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix unquoted backticks to prevent word splitting.

The Shellcheck warning SC2046 indicates that backticks should be quoted to prevent word splitting if DOCKER_COMPOSE_FILES contains spaces or special characters.

Apply this diff:

-docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
+docker compose $(echo ${DOCKER_COMPOSE_FILES}) exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
docker compose "$(echo ${DOCKER_COMPOSE_FILES})" exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
Suggested change
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
docker compose $(echo "${DOCKER_COMPOSE_FILES}") exec progs bash -c 'python manage.py migrate --settings=edraakprograms.dev'
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 18-18: Quote this to prevent word splitting.

(SC2046)

🤖 Prompt for AI Agents
In provision-progs.sh around line 18, the backtick command substitution is
unquoted which can cause word splitting; replace the backticks with a quoted
command substitution that quotes the variable, e.g. change the line to use
"$(echo "${DOCKER_COMPOSE_FILES}")" (or simply "$DOCKER_COMPOSE_FILES" if no
transformation is needed) so the expansion is quoted and prevents unwanted word
splitting.


echo "** Progs: Compiling assets **"
docker compose `echo ${DOCKER_COMPOSE_FILES}` exec progs bash -c 'npm rebuild node-sass'
Expand Down