-
Notifications
You must be signed in to change notification settings - Fork 0
fix: missing earthly target (used by agent tests) #291
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
Conversation
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Earthfile
participant ControllerGen
User->>Earthfile: Run manifests target
Earthfile->>Earthfile: Copy source and config files
Earthfile->>ControllerGen: Execute controller-gen with parameters
ControllerGen-->>Earthfile: Generate RBAC, CRDs, webhooks
Earthfile->>User: Output config as artifact
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🔭 Outside diff range comments (1)
Earthfile (1)
85-90
: Back-slash followed by a space breaks line-continuation + unnecessary extra layerLine 86 ends with
\
(a back-slash followed by a space).
In POSIX shells, any character after the back-slash cancels the line-continuation, so the longargocd app set …
command will actually terminate at the end of the line, and the next line will be treated as a brand-new command that starts with--parameter
, causing a syntax error.
Since you are touching this vicinity, fix the stray space and at the same time fold the subsequentargocd app sync
into the same RUN to avoid an extra image layer:-RUN --secret AUTH_TOKEN \ - argocd app set $APPLICATION \ - --parameter image.tag=$TAG \ - --auth-token=$AUTH_TOKEN --server=$SERVER --grpc-web -RUN --secret AUTH_TOKEN argocd --auth-token=$AUTH_TOKEN --server=$SERVER --grpc-web app sync $APPLICATION +RUN --secret AUTH_TOKEN argocd app set $APPLICATION \ + --parameter image.tag=$TAG \ + --auth-token=$AUTH_TOKEN --server=$SERVER --grpc-web && \ + argocd app sync $APPLICATION \ + --auth-token=$AUTH_TOKEN --server=$SERVER --grpc-web
🧹 Nitpick comments (1)
Earthfile (1)
91-101
:manifests
target works but duplicates logic already present ingenerate
The new target successfully produces CRDs/RBAC/webhooks for the agent tests, but most steps (copy sources, set
WORKDIR
, mount Go caches, callcontroller-gen
) are already present in+generate
.
Consider re-using that stage to avoid code drift:-manifests: - FROM --pass-args +controller-gen - COPY (+sources/*) /src - WORKDIR /src/components/operator - COPY --dir config . - RUN --mount=type=cache,id=gomod,target=${GOPATH}/pkg/mod \ - --mount=type=cache,id=gobuild,target=/root/.cache/go-build \ - controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases - SAVE ARTIFACT config AS LOCAL config +manifests: + FROM --pass-args +generate # contains all sources & caches + WORKDIR /src/components/operator + RUN controller-gen rbac:roleName=manager-role \ + crd webhook \ + paths="./..." \ + output:crd:artifacts:config=config/crd/bases + SAVE ARTIFACT config AS LOCAL configBenefits:
• Single source of truth for copying sources and cache mounts
• Smaller build graph and layer reuse
• Less maintenance when the code layout changesIf re-use is not feasible, at least add a
rm -rf config/crd/bases
before thecontroller-gen
call to prevent stale manifests being saved.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Earthfile
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Dirty
No description provided.