-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Added generated types from frontend apps to .dockerignore
#26024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request adds a new ignore pattern to the .dockerignore file. Specifically, it adds Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.dockerignore:
- Around line 11-12: The .dockerignore entry "apps/*/types" doesn't match nested
paths like "apps/stats/src/types"; update the pattern so generated type
directories are excluded during Docker builds by replacing "apps/*/types" with a
glob that covers deeper nesting such as "apps/**/types" (or specifically
"apps/*/src/types") in the .dockerignore file.
| apps/*/types | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's see the overall structure of the repository
git ls-files | head -30Repository: TryGhost/Ghost
Length of output: 1056
🏁 Script executed:
# Check the structure under apps/
fd -t d -L . apps/ | head -50 | sortRepository: TryGhost/Ghost
Length of output: 1819
🏁 Script executed:
# Find all directories named 'types' in the repository
fd -t d '^types$' .Repository: TryGhost/Ghost
Length of output: 146
🏁 Script executed:
# Check if there are any nested app structures (apps/*/apps/*/types)
find apps -type d -name types 2>/dev/null | head -30Repository: TryGhost/Ghost
Length of output: 78
🏁 Script executed:
# Let's get a complete picture of all types directories under apps/
find apps -type d -name types 2>/dev/null | sortRepository: TryGhost/Ghost
Length of output: 78
🏁 Script executed:
# Check which apps exist and if they have types directories
for app in $(ls -d apps/*/); do
echo "=== App: $app ==="
if [ -d "${app}types" ]; then
echo " Found: ${app}types"
fi
if [ -d "${app}src/types" ]; then
echo " Found: ${app}src/types"
fi
doneRepository: TryGhost/Ghost
Length of output: 487
🏁 Script executed:
# Let's also check the .dockerignore file to see its current content
cat -n .dockerignoreRepository: TryGhost/Ghost
Length of output: 666
🏁 Script executed:
# Check if apps/stats/src/types is tracked in git or gitignored
git ls-files apps/stats/src/types 2>/dev/null | head -10Repository: TryGhost/Ghost
Length of output: 150
🏁 Script executed:
# Check if it's in .gitignore
git check-ignore -v apps/stats/src/types 2>/dev/null || echo "Not in .gitignore"Repository: TryGhost/Ghost
Length of output: 75
🏁 Script executed:
# Let's check what files are in that directory to understand its purpose
find apps/stats/src/types -type f 2>/dev/null | head -20Repository: TryGhost/Ghost
Length of output: 150
Pattern mismatch: apps/*/types will not exclude the generated types directory.
The pattern apps/*/types matches directories like apps/admin/types, but the actual types directory in the repository is apps/stats/src/types. A single asterisk matches only one directory level, so the current pattern will fail to exclude generated types from Docker builds.
Use apps/*/src/types or apps/**/types instead to correctly exclude types directories nested under src/.
🤖 Prompt for AI Agents
In @.dockerignore around lines 11 - 12, The .dockerignore entry "apps/*/types"
doesn't match nested paths like "apps/stats/src/types"; update the pattern so
generated type directories are excluded during Docker builds by replacing
"apps/*/types" with a glob that covers deeper nesting such as "apps/**/types"
(or specifically "apps/*/src/types") in the .dockerignore file.
No changes to functionality included in this change.
When running
yarn docker:buildlocally (which is required to run e2e tests locally), the build was sometimes flaky when building the frontend apps. These generated typescript types were not in the .dockerignore, so stale types from local builds could pollute the docker image and ultimately cause the build to fail.Adding these generated types directories to the .dockerignore seems to eliminate this flakiness by ensuring it only uses the latest and greatest type definitions.