Skip to content

Commit ae15cd2

Browse files
authored
Merge pull request #39129 from github/repo-sync
Repo sync
2 parents 21aae2c + 74f13e6 commit ae15cd2

File tree

4 files changed

+65
-24
lines changed

4 files changed

+65
-24
lines changed

Dockerfile

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,28 @@ RUN --mount=type=secret,id=DOCS_BOT_PAT_BASE,mode=0444 \
5454
. ./build-scripts/fetch-repos.sh
5555

5656
# -----------------------------------------
57-
# DEPENDENCIES STAGE: Install node packages
57+
# PROD_DEPS STAGE: Install production dependencies
5858
# -----------------------------------------
59-
FROM base AS dependencies
59+
FROM base AS prod_deps
6060
USER node:node
6161
WORKDIR $APP_HOME
6262

6363
# Copy what is needed to run npm ci
6464
COPY --chown=node:node package.json package-lock.json ./
6565

66-
RUN npm ci --omit=optional --registry https://registry.npmjs.org/
66+
# Install only production dependencies (skip scripts to avoid husky)
67+
RUN npm ci --omit=dev --ignore-scripts --registry https://registry.npmjs.org/
6768

6869
# -----------------------------------------
69-
# BUILD STAGE: Prepare for production stage
70+
# ALL_DEPS STAGE: Install all dependencies on top of prod deps
71+
# -----------------------------------------
72+
FROM prod_deps AS all_deps
73+
74+
# Install dev dependencies on top of production ones
75+
RUN npm ci --registry https://registry.npmjs.org/
76+
77+
# -----------------------------------------
78+
# BUILD STAGE: Build the application
7079
# -----------------------------------------
7180
FROM base AS build
7281
USER node:node
@@ -84,14 +93,27 @@ COPY --chown=node:node --from=clones $APP_HOME/assets assets/
8493
COPY --chown=node:node --from=clones $APP_HOME/content content/
8594
COPY --chown=node:node --from=clones $APP_HOME/translations translations/
8695

87-
# From the dependencies stage
88-
COPY --chown=node:node --from=dependencies $APP_HOME/node_modules node_modules/
96+
# From the all_deps stage (need dev deps for build)
97+
COPY --chown=node:node --from=all_deps $APP_HOME/node_modules node_modules/
98+
99+
# Build the application
100+
RUN npm run build
101+
102+
# -----------------------------------------
103+
# WARMUP_CACHE STAGE: Warm up remote JSON cache
104+
# -----------------------------------------
105+
FROM build AS warmup_cache
106+
107+
# Generate remote JSON cache
108+
RUN npm run warmup-remotejson
89109

90-
# Generate build files
91-
RUN npm run build \
92-
&& npm run warmup-remotejson \
93-
&& npm run precompute-pageinfo -- --max-versions 2 \
94-
&& npm prune --production
110+
# -----------------------------------------
111+
# PRECOMPUTE STAGE: Precompute page info
112+
# -----------------------------------------
113+
FROM build AS precompute_stage
114+
115+
# Generate precomputed page info
116+
RUN npm run precompute-pageinfo -- --max-versions 2
95117

96118
# -------------------------------------------------
97119
# PRODUCTION STAGE: What will run on the containers
@@ -112,13 +134,17 @@ COPY --chown=node:node --from=clones $APP_HOME/assets assets/
112134
COPY --chown=node:node --from=clones $APP_HOME/content content/
113135
COPY --chown=node:node --from=clones $APP_HOME/translations translations/
114136

115-
# From dependencies stage (*modified in build stage)
116-
COPY --chown=node:node --from=build $APP_HOME/node_modules node_modules/
137+
# From prod_deps stage (production-only node_modules)
138+
COPY --chown=node:node --from=prod_deps $APP_HOME/node_modules node_modules/
117139

118140
# From build stage
119141
COPY --chown=node:node --from=build $APP_HOME/.next .next/
120-
COPY --chown=node:node --from=build $APP_HOME/.remotejson-cache ./
121-
COPY --chown=node:node --from=build $APP_HOME/.pageinfo-cache.json.br* ./
142+
143+
# From warmup_cache stage
144+
COPY --chown=node:node --from=warmup_cache $APP_HOME/.remotejson-cache ./
145+
146+
# From precompute_stage
147+
COPY --chown=node:node --from=precompute_stage $APP_HOME/.pageinfo-cache.json.br* ./
122148

123149
# This makes it possible to set `--build-arg BUILD_SHA=abc123`
124150
# and it then becomes available as an environment variable in the docker run.

content/copilot/concepts/copilot-billing/understanding-and-managing-requests-in-copilot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ redirect_from:
1616
> [!IMPORTANT]
1717
> * Billing for premium requests began on June 18, 2025 for all paid {% data variables.product.prodname_copilot_short %} plans, and the request counters were only set to zero for paid plans.
1818
> * {% data reusables.copilot.data-residency-availability %}
19-
> * Premium request counters reset on the 1st of each month. See [AUTOTITLE](/copilot/managing-copilot/understanding-and-managing-copilot-usage/monitoring-your-copilot-usage-and-entitlements).
19+
> * Premium request counters reset on the 1st of each month at 00:00:00 UTC. See [AUTOTITLE](/copilot/managing-copilot/understanding-and-managing-copilot-usage/monitoring-your-copilot-usage-and-entitlements).
2020
> * Certain requests may experience rate limits to accommodate high demand. Rate limits restrict the number of requests that can be made within a specific time period.
2121
2222
## What is a request?

content/copilot/how-tos/monitoring-your-copilot-usage-and-entitlements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ redirect_from:
1616
You can track your monthly usage of premium requests to help you get the most value from your {% data variables.product.prodname_copilot_short %} plan.
1717

1818
> [!NOTE]
19-
> Premium request counters reset on the 1st of each month.
19+
> Premium request counters reset on the 1st of each month at 00:00:00 UTC.
2020
2121
## Viewing premium request usage
2222

src/deployments/production/build-scripts/fetch-repos.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,29 @@ echo "Merging early access..."
3333
mkdir -p translations
3434
cd translations
3535

36-
# Iterate over each language
37-
echo "Fetching translations..."
38-
for lang in "es-es" "ja-jp" "pt-br" "zh-cn" "ru-ru" "fr-fr" "ko-kr" "de-de"
39-
do
40-
translations_repo="docs-internal.$lang"
41-
clone_or_use_cached_repo "$lang" "$translations_repo" "main"
36+
# Temporarily turn off exit-on-error so we can collect all PIDs
37+
set +e
38+
39+
pids=""
40+
for lang in es-es ja-jp pt-br zh-cn ru-ru fr-fr ko-kr de-de; do
41+
clone_or_use_cached_repo "$lang" "docs-internal.$lang" "main" &
42+
pids="$pids $!"
43+
done
44+
45+
failures=0
46+
for pid in $pids; do
47+
wait "$pid" || failures=$((failures+1))
4248
done
43-
echo "Done fetching translations."
49+
50+
# Restore strict mode
51+
set -e
52+
53+
if [ "$failures" -gt 0 ]; then
54+
echo "⚠️ $failures translation repo(s) failed to fetch."
55+
exit 1
56+
else
57+
echo "✅ All translations fetched."
58+
fi
4459

4560
# Go back to the root of the docs-internal repo
4661
cd ..

0 commit comments

Comments
 (0)