-
Notifications
You must be signed in to change notification settings - Fork 47
Feat/automation build #48
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
Changes from all commits
e8ebc1e
2ca75f8
c249393
b5670e8
0e2116f
8d380e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,16 @@ RUN git remote add upstream https://github.com/BrowserOperator/browser-operator- | |
RUN git fetch upstream | ||
RUN git checkout upstream/main | ||
|
||
# Build Browser Operator version | ||
# Allow configurable automated mode | ||
ARG AUTOMATED_MODE=false | ||
|
||
# Set build-time flags based on Docker arg | ||
RUN if [ "$AUTOMATED_MODE" = "true" ]; then \ | ||
sed -i 's/AUTOMATED_MODE: false/AUTOMATED_MODE: true/' \ | ||
front_end/panels/ai_chat/core/BuildConfig.ts; \ | ||
fi | ||
|
||
# Build Browser Operator version with current changes | ||
RUN npm run build | ||
Comment on lines
+59
to
60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain“with current changes” is misleading; build ignores PR workspace unless you COPY it. This stage checks out upstream/main and never copies the PR’s tree, so local changes won’t be in the build. If the intent is to build this PR, COPY the needed paths (or the entire repo) before running Minimal overlay to include PR edits in the output: -# Build Browser Operator version with current changes
-RUN npm run build
+# Build Browser Operator version with current changes
+# (already added above) COPY front_end /workspace/devtools/devtools-frontend/front_end
+RUN npm run build If you intentionally build a remote ref, consider making it explicit: - RUN git fetch upstream
- RUN git checkout upstream/main
+ ARG SOURCE_REF=main
+ RUN git fetch upstream ${SOURCE_REF} && git checkout FETCH_HEAD 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo "Listing repo root:"
ls -la
echo
echo "Find Dockerfile(s) (using fd if available, fallback to find):"
if command -v fd >/dev/null 2>&1; then
fd -HI -t f 'Dockerfile' || true
else
find . -maxdepth 6 -type f -name 'Dockerfile' || true
fi
echo
echo "Search for 'RUN npm run build' across repo:"
rg -n --hidden -S "RUN npm run build" -g '!*node_modules/**' || true
echo
# Prefer docker/Dockerfile if present
if [ -f docker/Dockerfile ]; then
echo "---- docker/Dockerfile (with line numbers) ----"
nl -ba docker/Dockerfile | sed -n '1,240p'
echo "---- Relevant matches in docker/Dockerfile ----"
rg -n -C3 "git fetch|checkout upstream|checkout|upstream/main|COPY|WORKDIR|ARG SOURCE_REF|RUN npm run build" docker/Dockerfile || true
else
echo "docker/Dockerfile not found — printing every Dockerfile that contains 'npm run build'."
files=$(rg --no-line-number --hidden -S "RUN npm run build" --glob '!*node_modules/**' --files || true)
if [ -z "$files" ]; then
echo "No Dockerfile with 'npm run build' found."
else
for f in $files; do
echo
echo "---- $f (with line numbers) ----"
nl -ba "$f" | sed -n '1,240p'
echo "---- Relevant matches in $f ----"
rg -n -C3 "git fetch|checkout upstream|checkout|upstream/main|COPY|WORKDIR|ARG SOURCE_REF|RUN npm run build" "$f" || true
done
fi
fi
echo
echo "Also search repository for 'git fetch upstream' or 'checkout upstream' to confirm behavior:"
rg -n --hidden -S "git fetch upstream|checkout upstream|checkout FETCH_HEAD|checkout upstream/main" || true Length of output: 3814 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo
echo "---- docker/Dockerfile (full) ----"
sed -n '1,400p' docker/Dockerfile || true
echo
echo "---- Repo-wide searches ----"
echo "RUN npm run build occurrences:"
grep -nR --line-number --binary-files=without-match "RUN npm run build" || true
echo
echo "git fetch / checkout upstream occurrences:"
grep -nR --line-number --binary-files=without-match -E "git fetch|checkout upstream|checkout FETCH_HEAD|upstream/main" || true
echo
echo "COPY of front_end / repo files occurrences:"
grep -nR --line-number --binary-files=without-match -E "COPY .*front_end|COPY .*front-end|COPY \.|COPY .* /workspace" || true
echo
echo "---- Context around 'RUN npm run build' in docker/Dockerfile ----"
grep -n -C3 --line-number "RUN npm run build" docker/Dockerfile || true Length of output: 3481 Build ignores local PR edits — Dockerfile checks out upstream/main before the final build. docker/Dockerfile adds an upstream remote and runs git fetch && git checkout upstream/main before the second RUN npm run build and never COPYs the repo into the image, so “current changes” won’t be included. Location: docker/Dockerfile lines 46–60. Minimal overlay to include PR edits in the output: -# Build Browser Operator version with current changes
-RUN npm run build
+# Build Browser Operator version with current changes
+# (already added above) COPY front_end /workspace/devtools/devtools-frontend/front_end
+RUN npm run build If you intentionally build a remote ref, make that explicit: - RUN git fetch upstream
- RUN git checkout upstream/main
+ ARG SOURCE_REF=main
+ RUN git fetch upstream ${SOURCE_REF} && git checkout FETCH_HEAD
🤖 Prompt for AI Agents
|
||
|
||
# Production stage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2025 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* Build-time configuration for automated deployments and Docker environments. | ||
* | ||
* This file contains constants that are set during the build process to configure | ||
* behavior for different deployment scenarios. | ||
*/ | ||
export const BUILD_CONFIG = { | ||
/** | ||
* Automated mode flag for Docker/CI deployments. | ||
* When true: | ||
* - Bypasses OAuth authentication panel | ||
* - Automatically enables evaluation mode | ||
* - Optimized for headless/automated usage | ||
*/ | ||
AUTOMATED_MODE: false, // Will be set to true during Docker build | ||
} as const; |
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.
[P1] Automated build never toggles automated mode
The README claims automated mode is the default build (
docker build -f docker/Dockerfile -t browser-operator-automated .
), but the Dockerfile declaresARG AUTOMATED_MODE=false
and only flips the flag when the arg is explicitlytrue
. With the documented command thesed
step is skipped, leavingBUILD_CONFIG.AUTOMATED_MODE
false so OAuth is still shown and evaluation stays manual. Builders will never get the advertised automated behavior unless they pass--build-arg AUTOMATED_MODE=true
. Consider changing the default to true or update the instructions to pass the arg when automated mode is desired.Useful? React with 👍 / 👎.