Skip to content

Commit d370207

Browse files
committed
Add debug logging to privacy policy integration, run astro build on GitHub to verify green build
1 parent cede0ff commit d370207

4 files changed

Lines changed: 41 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ jobs:
4141
- name: Install dependencies
4242
run: npm ci --legacy-peer-deps
4343

44+
- name: Install Chromium system dependencies
45+
run: npx playwright install-deps chromium
46+
4447
- name: Sync Astro types
4548
run: npm run sync
4649

47-
- name: Run Astro check
48-
run: npm run check
50+
- name: Run Astro build
51+
run: npm run build
4952

5053
- name: Run lint
5154
run: npm run lint:base

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171
"@nanostores/lit": "^0.2.3",
7272
"@nanostores/persistent": "^1.2.0",
7373
"@playwright/browser-chromium": "^1.57.0",
74+
"@playwright/test": "1.57.0",
7475
"@semantic-ui/astro-lit": "^5.1.1",
7576
"@sentry/astro": "^10.31.0",
7677
"@sentry/browser": "^10.31.0",
7778
"@shikijs/transformers": "^3.20.0",
78-
"@tailwindcss/forms": "0.5.10",
79+
"@tailwindcss/forms": "0.5.11",
7980
"@tailwindcss/typography": "0.5.19",
8081
"@tailwindcss/vite": "^4.1.18",
8182
"@types/hast": "^3.0.4",
@@ -147,7 +148,6 @@
147148
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
148149
"@eslint/js": "9.39.2",
149150
"@happy-dom/global-registrator": "^20.0.11",
150-
"@playwright/test": "1.57.0",
151151
"@testing-library/dom": "10.4.1",
152152
"@testing-library/preact": "3.2.4",
153153
"@testing-library/user-event": "14.6.1",
@@ -173,7 +173,7 @@
173173
"@vitest/coverage-v8": "^4.0.16",
174174
"confusing-browser-globals": "1.0.11",
175175
"cross-spawn": "7.0.6",
176-
"dedent": "^1.7.0",
176+
"dedent": "^1.7.1",
177177
"dotenv-cli": "11.0.0",
178178
"eslint": "9.39.2",
179179
"eslint-import-resolver-typescript": "^4.4.4",

src/integrations/PrivacyPolicyVersion/index.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ const PROJECT_ROOT = getProjectRoot()
4242
const PRIVACY_POLICY_FILEPATH = posix.join('src', 'pages', 'privacy', 'index.astro')
4343
const GIT_DIRECTORY_PATH = join(PROJECT_ROOT, '.git')
4444

45+
const debugListDirectory = (label: string, directoryPath: string): void => {
46+
try {
47+
const entries = fs.readdirSync(directoryPath)
48+
const maxEntriesToLog = 60
49+
const visibleEntries = entries.slice(0, maxEntriesToLog)
50+
const suffix = entries.length > maxEntriesToLog ? ` … (+${entries.length - maxEntriesToLog} more)` : ''
51+
52+
console.log(
53+
`[privacy-policy-version] Debug: ls ${label}: ${directoryPath} -> ${visibleEntries.join(', ')}${suffix}`,
54+
)
55+
} catch (error) {
56+
console.log(
57+
`[privacy-policy-version] Debug: ls ${label} failed for ${directoryPath}: ${error instanceof Error ? error.message : String(error)}`,
58+
)
59+
}
60+
}
61+
4562
export const toIsoDateString = (date: Date): string => date.toISOString().slice(0, 10)
4663

4764
const formatGitShortDate = (timestamp: number, timezoneOffset: number): string => {
@@ -116,6 +133,21 @@ export async function resolvePrivacyPolicyVersion(): Promise<string> {
116133
}
117134
} else {
118135
console.warn('[privacy-policy-version] Git metadata not found. Skipping git lookup.')
136+
137+
// Debugging for Vercel/CI environments where git history may be absent.
138+
console.log(`[privacy-policy-version] Debug: pwd (process.cwd): ${process.cwd()}`)
139+
console.log(`[privacy-policy-version] Debug: PROJECT_ROOT: ${PROJECT_ROOT}`)
140+
console.log(`[privacy-policy-version] Debug: expected .git directory: ${GIT_DIRECTORY_PATH}`)
141+
142+
debugListDirectory('PROJECT_ROOT', PROJECT_ROOT)
143+
debugListDirectory('process.cwd()', process.cwd())
144+
145+
const privacyPolicyAbsolute = join(PROJECT_ROOT, PRIVACY_POLICY_FILEPATH)
146+
console.log(`[privacy-policy-version] Debug: privacy policy filepath (relative): ${PRIVACY_POLICY_FILEPATH}`)
147+
console.log(`[privacy-policy-version] Debug: privacy policy filepath (absolute): ${privacyPolicyAbsolute}`)
148+
console.log(
149+
`[privacy-policy-version] Debug: privacy policy file exists: ${fs.existsSync(privacyPolicyAbsolute)}`,
150+
)
119151
}
120152

121153
const fallback = toIsoDateString(new Date())

src/lib/helpers/breadcrumbTitleLengthRefinement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from 'astro:content'
22
import { isProd } from '@lib/config/environmentServer'
33

4-
const MAX_BREADCRUMB_TITLE_LENGTH = 50
4+
const MAX_BREADCRUMB_TITLE_LENGTH = 55
55
const loggedBreadcrumbTitleWarnings = new Set<string>()
66

77
export const warnOnBreadcrumbTitleLength = (title: string, collectionName: string): void => {

0 commit comments

Comments
 (0)