[LP-492] Make lockfiles optional and improve build flexibility#6
[LP-492] Make lockfiles optional and improve build flexibility#6
Conversation
6b785d2 to
fc620ea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {{ if eq .package_manager "npm" }} | ||
| COPY package*.json ./ | ||
| {{ else if eq .package_manager "yarn" }} | ||
| COPY package.json yarn.lock ./ | ||
| COPY package.json yarn.lock* ./ | ||
| {{ else }} | ||
| COPY package.json pnpm-lock.yaml ./ | ||
| COPY package.json pnpm-lock.yaml* ./ |
There was a problem hiding this comment.
Make yarn/pnpm lockfiles truly optional
COPY package.json yarn.lock* ./ still fails when yarn.lock is absent because Docker requires every COPY source to resolve to at least one file; an unmatched glob raises no source files were specified. As a result, Yarn (and pnpm) templates will continue to fail to build when no lockfile is supplied despite relaxing the install commands. Consider splitting the copy into two commands or using a pattern that always matches (e.g. package*.json) so lockfiles are genuinely optional across all affected templates (Express, NestJS, React, Next.js, Vue).
Useful? React with 👍 / 👎.
d5611f9 to
b037b56
Compare
**Lockfile Changes:** - npm: Replace 'npm ci' with 'npm install --no-audit --prefer-offline' - yarn: Use 'yarn.lock*' wildcard and remove '--frozen-lockfile' - pnpm: Use 'pnpm-lock.yaml*' wildcard and remove '--frozen-lockfile' - pipenv: Remove '--deploy' flag to allow builds without Pipfile.lock - gradle: Use 'settings.gradle.kts*' wildcard for single-module projects **Build Robustness Improvements:** - Next.js: Ensure public directory exists in builder stage - Spring Boot: Improve JAR file selection logic with fallback - Kotlin Spring Boot: Improve JAR file selection logic with fallback - Django/FastAPI: Simplify Python package copying to avoid version mismatch Allow builds without lockfiles for maximum flexibility while still using lockfiles when available for reproducible builds. Affected templates: - Frontend: React, Next.js, Vue.js - Backend Node.js: Express.js, NestJS - Backend Python: Django, FastAPI, Flask - Backend JVM: Spring Boot, Kotlin Spring Boot LP-492
b037b56 to
111cf49
Compare
- Remove redundant "(선택사항)" labels (already shown by category) - Remove confusing "myapp" placeholder from database_name defaults - Make SQL root passwords required (MySQL, PostgreSQL) - Add fallback values for PostgreSQL ENV variables - Reorder required fields for better UX LP-492
Summary
Changes
Part 1: Lockfile Optional 처리 (10개 애플리케이션 템플릿)
npm (React, Next.js, Vue.js, Express.js, NestJS)
npm ci→npm install --no-audit --prefer-offline로 변경yarn (React, Next.js, Vue.js, Express.js, NestJS)
COPY yarn.lock ./→COPY yarn.lock* ./로 wildcard 추가--frozen-lockfile플래그 제거pnpm (React, Next.js, Vue.js, Express.js, NestJS)
COPY pnpm-lock.yaml ./→COPY pnpm-lock.yaml* ./로 wildcard 추가--frozen-lockfile플래그 제거pipenv (Django, FastAPI, Flask)
COPY Pipfile.lock ./→COPY Pipfile.lock* ./로 wildcard 추가--deploy플래그 제거poetry (Django, FastAPI, Flask)
poetry.lock*wildcard 사용 중 (변경 없음)gradle (Spring Boot, Kotlin Spring Boot)
COPY settings.gradle.kts ./→COPY settings.gradle.kts* ./로 wildcard 추가Part 2: 빌드 안정성 개선 (5개 애플리케이션 템플릿)
Next.js
RUN mkdir -p public추가로 빈 디렉토리 생성Spring Boot & Kotlin Spring Boot
RUN cp $(find build/libs -name "*[!n].jar" -type f | head -n 1) app.jar 2>/dev/null || cp build/libs/*.jar app.jarDjango & FastAPI
/usr/local/lib/python{{ .python_version }}/site-packages→/usr/local/lib전체 복사Part 3: 데이터베이스 템플릿 UX 개선 (4개 DB 템플릿)
레이블 중복 제거 (12개 필드)
category: "optional"로 표시되는데 레이블에도 " (선택사항)" 포함플레이스홀더 제거 (2개 필드)
SQL 비밀번호 필수화 (2개 템플릿)