Repository navigation
build: give the it-test MongoDB image its own name (PR 3 of #958) - #1009
Open
ismisepaul wants to merge 2 commits into
Open
ismisepaul wants to merge 2 commits into
ismisepaul wants to merge 2 commits into
Conversation
The it-test profile (-DmongoDocker) named the image it builds from
docker/mongo/Dockerfile mongo:${MONGODB_VERSION}, the tag of the official
image that Dockerfile builds FROM. After one local integration-test run the
next build started from the custom image, which ends with USER mongodb, and
failed with "chown: changing ownership of '/etc/mongod.conf': Operation not
permitted". docker compose build failed the same way.
Name it ${IMAGE_MONGO}:it (owasp/security-shepherd_mongo:it) instead, which
docker compose does not use either, since it builds and runs the :latest tag.
The alias keeps the container name mongo-1, which AGENTS.md's clean-up step
filters on. Replace the AGENTS.md workaround with a note on the new name.
Closes #938
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The explicitly requested validation of two consecutive Docker integration-test runs still needs human confirmation before merging.
No open issues 🎉
What changed in this PR
This PR isolates the MongoDB integration-test image from the official base image, addressing #938 within the MongoDB upgrade stack.
Changes:
- Tags the test image as
${IMAGE_MONGO}:it, preventing builds from overwriting the official MongoDB tag. - Preserves the
mongo-1container name so existing cleanup commands still work. - Updates troubleshooting guidance to retain only the one-time recovery step for previously overwritten tags.
| File | Description |
|---|---|
| pom.xml | Gives the integration-test image a separate tag and preserves container naming. |
| AGENTS.md | Documents the new image name and removes the recurring tag-restoration workaround. |
Review effort: Balanced
Keep the image-smoke-test paragraph in AGENTS.md alongside this PR's it-test paragraph, which replaces the note about overwriting the tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The integration tests ran against real MongoDB 4.1.13 and 8.0.32, but nobody has played the NoSQL challenge end to end in the full app on this stack, and the 4.1 → 8.0 upgrade of an existing environment hasn't been tried.
Please run this branch, follow the steps, and comment on this PR with the result: pass, or the step that failed and what you saw.
Branch:
dev#992-nosql-shared-clientThis PR is part of a stack (#1007, then #1008, then #1009, then #1019). Each branch contains the ones below it, so testing the top branch,
dev#992-nosql-shared-client, covers the whole stack. To test only this PR, use its own branch.This PR on its own: step 6.
Set up. Use a machine where the Shepherd Docker volumes can be thrown away:
down -vdeletes their data. JDK 17 and Maven 3.9.2+ are needed.git fetch origin git checkout 'dev#992-nosql-shared-client' mvn -Pdocker clean install -DskipTests docker compose down -v docker compose up -d --buildadmin/passwordand set a new password when asked.Test
docker exec secshep_mongo mongod --version. It should say v8.0.32.';return(true);var a='a. It should list every gamer, including the row with the result key.': an error message, not a hang.dev(MongoDB 4.1), check out this branch and follow the README's MongoDB 8.0 section (remove themongodatavolume, rebuild). Themongocontainer must start and step 2 must work.mvn verify -DskipUTs=true -DmongoDocker -Btwice in a row against the test database from AGENTS.md. The second run must not fail withchown ... Operation not permitted, anddocker images mongomust still show the official image.It's broken if: the NoSQL level doesn't list the gamers for the injection, stops answering after the first submission, or the
mongocontainer doesn't start after the upgrade steps.PR 3 of #958. Stacked on the server PR. Fixes #938.
What
The
it-testprofile (-DmongoDocker) tagged the image it builds asmongo:${MONGODB_VERSION}. That's the same tag as the official image its Dockerfile buildsFROM, so after one local run the next build failed withchown … Operation not permitted.${IMAGE_MONGO}:it(owasp/security-shepherd_mongo:it). Compose uses:latest, so they don't clash.containerNamePattern%a-%iwith aliasmongokeeps the container namemongo-1. The plugin's default would name it after the image (security-shepherd_mongo-1), which the clean-up filter in AGENTS.md (^mongo-[0-9]+$) doesn't match. Checked:docker:startcreatesmongo-1, anddocker:stopremoves it.Tests
test.ymlpassed locally on this branch.mongo:8.0.32still has its registry digest.🤖 Generated with Claude Code