Skip to content

Conversation

@webberwang
Copy link
Member

Description

Video or Image

Related Issue(s)

Fixes #3760

webberwang and others added 30 commits July 4, 2025 11:27
Updated the README to reflect that nx.sh is no longer used and instead users should use an nx
alias to add --output-style=stream to all commands. This aligns with the current implementation
where the nx.sh wrapper script has been removed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace Terraform Cloud-based version management with direct git tag usage. Docker images are now
tagged based on semantic version tags (e.g., 1.2.3) found on commits, or 'latest' if no tag exists.

Key changes:
- Remove increment-docker-version scripts and Terraform Cloud variable updates
- Add Docker tag detection logic to env.sh for centralized version management
- Create validate-git-tag.sh script for semantic version validation
- Update all Docker build jobs to use setup-env for consistent versioning
- Add TF_VAR_DOCKER_TAG_VERSION export for Terraform compatibility
- Simplify setup-infra-workspace job by removing redundant version logic
- Add comprehensive documentation in .claude/documentation/git-tag-version-control.md

This simplifies the deployment process by using git tags as the single source of truth for
versioning, eliminating the need for external version tracking in Terraform Cloud.
Update infra-pr workflow to trigger on semantic version tags (x.y.z pattern) in addition to
staging branch. This allows tagged releases to trigger the full infrastructure deployment
pipeline.
- Update infra-pr workflow to trigger on staging branch only
- Create infra-pr-tag workflow to trigger on version tags only
- Remove unnecessary branch ignore filters from tag workflow
- Fix env.sh to use relative path for validation script

This prevents duplicate workflow runs when pushing both branch and tag.
- Replace bash validation script with Node.js validate-semver.js
- Handle all version logic in the JS script (empty, valid, invalid)
- Simplify env.sh to just call the validation script
- Remove conditional logic from env.sh for cleaner code
- Update both infra-pr and infra-pr-tag workflows to build Docker images earlier
- Docker builds now only depend on setup-infra-workspace instead of tf-apply-ci
- This allows Docker builds to run in parallel with terraform planning/applying
- Significantly reduces total pipeline time while maintaining safety checks

The production terraform deployment still waits for all Docker builds to complete
before proceeding, ensuring images are ready when needed.
…ions

- Add test environment examples for API and sites apps
- Update Auth0 Terraform client configurations for machine and web clients
- Document TypeScript class member ordering rules
- Add Ant Design icon import convention
- Include other common linting rules
- Add AppCard, AppsSummary, and PageLayout components for sites app
- Update ElementWrapper with logging integration
- Add browser logger service and React hook
- Update project configuration and dependencies
… access

Prevent TypeRef resolution errors in production mode where atom API types
aren't loaded. MobX initializes all computed properties even if unused.

Closes #3760
Add TypeScript path mapping for @codelab/frontend-application-app/use-cases/page-preview
to fix module resolution error in sites app build.
- Extract shared batching logic from server to client module
- Rename server files to follow .server.ts convention
- Enable Apollo Server batch operation support
- Configure batch fetcher with 20ms window and max 10 operations
- Eliminate code duplication between client and server fetch implementations

Co-Authored-By: Claude <noreply@anthropic.com>
- Add timing information to logger output for better performance tracking
- Convert sequential atom processing to parallel with Promise.all
- Update atom and type application services for parallel execution
- Add structured logging with operation context and duration

Co-Authored-By: Claude <noreply@anthropic.com>
- Add page production query and hydration utilities
- Update CLAUDE.md with commit guidelines
- Fix TypeScript compilation and linting issues
- Update package.json and codegen configuration
- Improve node-fetch agent configuration

Co-Authored-By: Claude <noreply@anthropic.com>
- Add 'export const dynamic = force-dynamic' to root page to prevent static generation
- Root page fetches data from API which isn't available during build
- This ensures the page is rendered at runtime when API is available
- Mock @codelab/shared-infra-auth0/client in jest.mocks.ts
- Prevents import of Next.js server-side APIs in test environment
- Fixes 'Request is not defined' error introduced in commit af4d50a
…tion to server module

- Move BatchFetcher class and related logic from client to server module
- Remove dependency on client-side batch fetch implementation
- Maintain same functionality with server-side implementation
…ve .server suffix

- Rename batch-fetch.server.ts to batch-fetch.ts
- Rename fetch-with-auth.server.ts to fetch-with-auth.ts
- Update import paths in dependent files
Remove alphabetical sorting of fields during export to maintain the original
field order based on sibling relationships. This ensures that imported and
exported data remain identical.
Add explicit tsc-check targets to override plugin's incorrect dist path resolution
- Add nvm loading before using npx to ensure node/npm are available
- Add debug logging to validate-semver.js for better error visibility
- Ensure validate-semver.js handles empty version tags gracefully
- Fix MODULE_NOT_FOUND error by loading nvm from $HOME/.nvm/nvm.sh
- Add load-nvm step after install-nvm in CircleCI jobs
- Remove manual nvm loading from env.sh
- Clean up debug output from env.sh
- This ensures nvm/node/npm are properly loaded before setup-env runs
- Add source $BASH_ENV at the end of install-nvm.sh
- Remove unnecessary load-nvm steps from all jobs
- This ensures nvm is available immediately after installation
- Simplifies the CircleCI configuration
…abase

Remove the last reference to load-nvm command from restore-workspace-database.yml
since nvm is now loaded automatically via BASH_ENV after install-nvm.sh runs.
- Check if npx exists before attempting to use it
- Add detailed error messages showing PATH, npm, and node locations
- Check if validate-semver.js exists before running
- Capture and display both stdout and stderr from validate-semver.js
- Add success/failure messages throughout the script
- Make errors more descriptive to help with debugging CI issues
- Add set +e to prevent script from exiting on non-zero return codes
- Add detailed error handling for git log command with CIRCLE_SHA1
- Add git repository check before attempting to get tags
- Show current HEAD SHA for debugging
- List all tags before filtering for semantic versions
- Handle cases where CIRCLE_SHA1 is not set or invalid
webberwang and others added 8 commits July 13, 2025 11:05
- Add fallback empty object for Object.keys() when where is undefined
- Fixes TS2769 error in abstract.repository.ts

Co-Authored-By: Claude <noreply@anthropic.com>
- Add timing logs to seed app handler for system imports and data creation
- Implement detailed logging in component application service with progress tracking
- Add batch logging for element creation with unique batch IDs
- Track render type lookups and repository operations in element service
- Add request tracking for page creation workflow
- Implement timing wrapper for type application service field operations
- Add performance logging to atom domain service methods
- Track GraphQL mutation performance in element and field repositories
- Log node count before database reset operations
- Add array batching support for large GraphQL mutations
- Include batch mutation wrapper with tests for field creation optimization
Remove npx wrapper from validate-semver.js execution as npx is not available
at this stage in the CI environment. The validate-semver.js script uses
built-in regex validation and doesn't require the semver npm package.

This fixes the 'Setup Env env.sh Exited with code exit status 1' error
in CircleCI builds.
Move setup-env command to execute before attach_workspace and other operations
that depend on environment variables. This ensures all environment variables
are properly set before any workspace operations or subsequent commands.
Add extensive debug logging to identify where env.sh is failing:
- Enable bash debug mode (set -x) to show each command
- Add error trap to show exact line number of failures
- Add echo statements throughout to track progress
- Add checks for validate-semver.js existence
- Add error handling for node script execution
- Log environment variables and current state

This will help diagnose the 'Exited with code exit status 1' error
in CircleCI builds.
Remove all debug logging and error trapping now that the issue has been
resolved. The script is working correctly after removing the npx dependency.
Add '|| true' to grep command to prevent script failure when no semantic
version tags are found on the current commit. This fixes the 'Exited with
code exit status 1' error that occurs when grep returns no matches.
Add clarifying comment about why '|| true' is needed to prevent script
failure when no version tags exist on the current commit.
@nx-cloud
Copy link

nx-cloud bot commented Jul 15, 2025

View your CI Pipeline Execution ↗ for commit e5b561c

Command Status Duration Result
nx affected --target=lint -c ci ✅ Succeeded 16m 34s View ↗
nx affected --target=test -c ci.integration --r... ✅ Succeeded 14m 53s View ↗
nx e2e web-e2e -c ci --shard=2/4 ✅ Succeeded 6m 53s View ↗
nx e2e web-e2e -c ci --shard=3/4 ✅ Succeeded 4m 28s View ↗
nx e2e web-e2e -c ci --shard=1/4 ✅ Succeeded 3m 46s View ↗
nx e2e web-e2e -c ci --shard=4/4 ✅ Succeeded 1m 26s View ↗
nx run-many --target=tsc-check --target=tsc-che... ✅ Succeeded 3m 3s View ↗
nx run-many --target=build --all --exclude=web,... ✅ Succeeded 2m 36s View ↗
Additional runs (1) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-07-16 16:38:15 UTC

webberwang and others added 19 commits July 15, 2025 19:58
…rations

- Remove lint targets from all project.json files (173 projects)
- Add explicit lint targets using @nx/eslint:lint executor to all projects
- Add lint targets to 15 projects that were missing them
- Create tsconfig.spec.json for shared-infra-fetch to fix ESLint configuration
- Update nx.json to remove @nx/eslint/plugin in favor of explicit targets
- Add .eslintignore file for web app to exclude .next directory
- Fix arrow function lint errors in demo app

This change ensures consistent ESLint configuration across all projects
and resolves path resolution issues with the inferred lint targets.
…and demo

- Fix unnecessary conditional operators in backend-infra-core
- Convert function declarations to arrow functions in design-system and demo
- Update tsconfig and eslint config for design-system to include config files
- Move function definition before usage in design-system storybook config
… method

Add null check for optional where parameter when calling Object.keys()
to prevent TypeScript error TS2769
… library

- Move batch functionality from fetch-server to fetch library for client/server usage
- Create separate folders for two distinct batching strategies:
  - array-batching: Splits large mutation arrays into multiple requests
  - request-batching: Combines multiple GraphQL requests into single HTTP request
- Simplify batchArrayMutations API by moving validation logic internally
- Remove redundant mutation type checking and operation name extraction
- Rename files for clarity:
  - batch-mutation-wrapper → batch-array-mutations
  - batch-fetch → batch-graphql-requests
- Extract interfaces to separate files for better organization
- Add comprehensive documentation for both batching strategies
- Update all imports across the codebase
- Fix all tests to use the new simplified API

BREAKING CHANGE: batchArrayMutations API signature changed - no longer requires explicit config parameter
- fetchWithAuth depends on Auth0 client which uses Next.js server components
- Keep server-specific code in fetch-server library to avoid test environment issues
- Remove unnecessary jest mocks for shared fetch library
- Tests now pass without requiring global polyfills
- Replace short identifier names (f, t) with descriptive names
- Use 'fragment', 'field', 'type', 'enumType' as appropriate
- All CI linting now passes
Removed the logging strategy documentation file as it's no longer needed.
- Add browser logger to TypeDomainService with namespace 'service:type'
- Change environment variable from NEXT_PUBLIC_LOG_NAMESPACES to NEXT_PUBLIC_DEBUG
- Add separate API_DEBUG for backend with namespace validation
- Create shared logger utilities in @codelab/shared-infra-logger
- Share LogLevel, LogContext types between frontend and backend
- Rename library from shared-infra-logging to shared-infra-logger
- Update all imports across the codebase to use new library name
- Fix TypeScript compilation errors in logger configuration

Resolves #3736
…tations

- Add --cache flag to ESLint command for better performance
- Document that lint-staged runs outside Nx project context
- Explain cache limitations with cross-file dependencies
- Add .eslintcache to .gitignore
- Add TODO for future batching optimization
…ing rules

- Update CLAUDE.md with multi-line comment style requirement
- Update path-alias.json in workspace tools
- Modify type.domain.service.ts implementation
- Add --cache flag to Prettier command for better performance
- Add .prettiercache to .gitignore
- Add comment explaining cache usage for formatting
- Update shared-infra-logger to use correct naming convention
- Fix browser logger service import path
- Ensure logging path transformations follow new naming pattern

Co-Authored-By: Claude <noreply@anthropic.com>
…ogging

- Update path-alias.spec.ts to use correct logger path
- Update rename-npm-name.spec.ts to use logger instead of logging
- Fix tsconfig path expectations to match actual logger paths

Co-Authored-By: Claude <noreply@anthropic.com>
…rsion

- Replace imperative loops with functional recursion
- Use array spreading instead of mutation
- Add comprehensive documentation explaining the algorithm
- Maintain same behavior with cleaner functional approach

The refactor uses recursive array spreading to build linked lists without
side effects, making the code more declarative and easier to reason about.
… recursion

- Replace imperative loops with functional recursion
- Use array spreading instead of mutation
- Add comprehensive documentation explaining the algorithm
- Maintain same behavior with cleaner functional approach

The refactor uses recursive array spreading to build linked lists without
side effects, making the code more declarative and easier to reason about.
- Add litellm-config.yaml for LLM proxy configuration
- Update docker-compose.yaml to include litellm service
- Update logger configuration files for improved logging
- Fix linting issues in logger adapter
- Update logging namespace validation and constants
@webberwang webberwang merged commit 17338ce into master Jul 16, 2025
11 checks passed
@webberwang webberwang deleted the feat/3760-add-logging branch July 16, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix TypeRef resolution errors in production mode

2 participants