Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Setting up GitHub Copilot instructions for the TypeORM repository

  • Create .github/copilot-instructions.md file
  • Document repository structure and architecture
  • Document coding standards and conventions
  • Document testing practices
  • Document build and development workflow
  • Document database-specific considerations
  • Document contribution guidelines reference
  • Review and validate the instructions
  • Address PR feedback:
    • Simplified TypeScript configuration section (removed strict mode and reflect-metadata notes)
    • Added preference for functional tests over per-issue tests
    • Simplified test guidance to focus only on preferring functional tests

Summary

Successfully created comprehensive GitHub Copilot instructions for the TypeORM repository. The instructions file includes:

Coverage

  • Project Overview: Description of TypeORM as a multi-database ORM supporting Active Record and Data Mapper patterns
  • Architecture & Structure: Core components and design patterns used throughout the codebase
  • Coding Standards: TypeScript configuration, code style (Prettier/ESLint), naming conventions, and TypeScript patterns
  • Testing: Test structure with emphasis on preferring functional tests, writing guidelines, standard template, and running instructions
  • Database-Specific Considerations: Multi-database support and driver implementation details
  • Common Development Tasks: Adding features, decorators, and working with migrations
  • Build & Development Workflow: Commands, setup instructions, and pre-commit hooks
  • Contribution Guidelines: Commit message format and PR requirements
  • Common Patterns & Idioms: Code examples for entities, repositories, query builders, and transactions
  • Important Notes: Key considerations for developers
  • Resources: Links to documentation and guides

The instructions are based on the repository's existing documentation (CONTRIBUTING.md, DEVELOPER.md), configuration files (package.json, tsconfig.json, eslint.config.mjs, .prettierrc.json), and observed code patterns.

Original prompt

This section details on the original issue you should resolve

<issue_title>✨Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


PR Type

Documentation


Description

  • Add comprehensive GitHub Copilot instructions for TypeORM repository

  • Document architecture, core components, and design patterns

  • Codify coding standards, TypeScript configuration, and naming conventions

  • Provide testing guidelines with multi-database test patterns

  • Include development workflow, build commands, and contribution guidelines


Diagram Walkthrough

flowchart LR
  A["GitHub Copilot"] -- "reads instructions from" --> B[".github/copilot-instructions.md"]
  B -- "documents" --> C["Architecture & Components"]
  B -- "documents" --> D["Coding Standards"]
  B -- "documents" --> E["Testing Guidelines"]
  B -- "documents" --> F["Development Workflow"]
  B -- "documents" --> G["Contribution Guidelines"]
  C --> H["DataSource, EntityManager, Repository, QueryBuilder"]
  D --> I["TypeScript, Prettier, ESLint, Naming Conventions"]
  E --> J["Multi-database Tests, Test Templates"]
  F --> K["Build Commands, Pre-commit Hooks"]
  G --> L["Commit Format, PR Requirements"]
Loading

File Walkthrough

Relevant files
Documentation
copilot-instructions.md
Comprehensive GitHub Copilot instructions for TypeORM       

.github/copilot-instructions.md

  • Created comprehensive Copilot instructions document for TypeORM
    repository
  • Documented project overview, architecture, and core components
    (DataSource, EntityManager, Repository, QueryBuilder, decorators,
    drivers)
  • Specified coding standards including TypeScript configuration,
    Prettier/ESLint rules, and naming conventions
  • Provided testing guidelines with standard test template and
    multi-database test patterns
  • Included database-specific considerations and driver implementation
    details
  • Documented build commands, development workflow, and pre-commit hooks
  • Added contribution guidelines with commit message format and PR
    requirements
  • Included common patterns for entity definitions, repository usage,
    QueryBuilder, and transactions
+283/-0 

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 19, 2025

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 125ca62
Status:⚡️  Build in progress...

View logs

Copilot AI changed the title [WIP] Set up Copilot instructions for the repository Add GitHub Copilot instructions for TypeORM repository Nov 19, 2025
Copilot AI requested a review from naorpeled November 19, 2025 19:59
@naorpeled naorpeled marked this pull request as ready for review November 19, 2025 20:16
@qodo-free-for-open-source-projects
Copy link

qodo-free-for-open-source-projects bot commented Nov 19, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟢
🎫 #11593
🟢 Configure instructions for the repository following GitHub's best practices for Copilot
coding agent
Set up repository-specific instructions to help Copilot provide context-aware assistance
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link

qodo-free-for-open-source-projects bot commented Nov 19, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Address long-term maintenance of Copilot instructions

The new copilot-instructions.md file duplicates existing project information,
creating a maintenance risk of it becoming outdated. A process should be
established to keep it synchronized with the codebase.

Examples:

.github/copilot-instructions.md [41-46]
### Code Style

- **Formatting**: Use Prettier with these settings:
  - No semicolons (`"semi": false`)
  - Arrow function parentheses always (`"arrowParens": "always"`)
  - Trailing commas everywhere (`"trailingComma": "all"`)
.github/copilot-instructions.md [169-177]
### Commands

- **Build**: `npm run compile` - Compiles TypeScript to `build/compiled/`
- **Package**: `npm run package` - Creates distribution in `build/package/`
- **Pack**: `npm run pack` - Creates `.tgz` file in `build/`
- **Test**: `npm test` - Compile and run all tests
- **Lint**: `npm run lint` - Run ESLint
- **Format**: `npm run format` - Run Prettier
- **Watch**: `npm run watch` - Watch mode for TypeScript compilation

Solution Walkthrough:

Before:

// .github/copilot-instructions.md

## Code Style
- Formatting: Use Prettier with these settings:
  - No semicolons (`"semi": false`)
  - ...

## Build & Development Workflow
- Build: `npm run compile`
- Test: `npm test`
- ...

## Contribution Guidelines
- Follow conventional commits
- ...

After:

// Suggestion: Automate parts of the instructions file
// and add a CI check to ensure it's up-to-date.

// .github/copilot-instructions.md (partially auto-generated)
## Code Style
<!-- AUTO-GENERATED-FROM: .prettierrc, .eslintrc -->
- Formatting: Use Prettier with these settings:
  - No semicolons (`"semi": false`)
<!-- END-AUTO-GENERATED -->

// .github/workflows/ci.yml
jobs:
  verify_copilot_instructions:
    name: Verify Copilot Instructions
    runs-on: ubuntu-latest
    steps:
      - run: npm run generate-copilot-instructions
      - run: git diff --exit-code .github/copilot-instructions.md
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a significant long-term maintenance risk, as the new copilot-instructions.md file duplicates information from other sources and could become outdated, leading to incorrect AI-generated code.

Medium
General
Clarify entity pattern usage guidance

Clarify the instructions for entity instances to correctly represent both the
Data Mapper and Active Record patterns supported by TypeORM, instead of only
mentioning the Data Mapper pattern.

.github/copilot-instructions.md [275]

-- Entity instances should be plain objects, not class instances with methods (Data Mapper pattern)
+- When using the Data Mapper pattern, entity classes should primarily contain properties and relations. Business logic should be in services, and persistence logic in repositories.
+- For the Active Record pattern, entities extend `BaseEntity` and can have persistence methods like `save()` and `remove()`. Choose this pattern for simpler cases where logic is tightly coupled to the entity.
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a misleading instruction that contradicts other parts of the document regarding supported design patterns, and the proposed change provides necessary clarification.

Medium
Reduce commit subject line length limit

Reduce the maximum character limit for commit subject lines from 100 to 72 to
align with conventional commit standards and improve readability.

.github/copilot-instructions.md [211]

-- Max 100 characters per line
+- Max 72 characters
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion proposes changing the commit subject line length from 100 to 72 characters, which aligns with common Git best practices and improves commit history readability.

Low
  • Update

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great

@naorpeled
Copy link
Member

@copilot mention that we prefer functional tests instead of per-issues tests and only keep the target in the Typescript configuration section

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 21, 2025

@copilot mention that we prefer functional tests instead of per-issues tests and only keep the target in the Typescript configuration section

Done in dd099e1. Simplified the TypeScript configuration section to only show the target and decorator settings, and added a note emphasizing preference for functional tests over per-issue tests.

@naorpeled
Copy link
Member

@copilot please refrain from writing "use only when a functional test is not appropriate", instead only focus on the "prefer functional tests" part

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 21, 2025

@copilot please refrain from writing "use only when a functional test is not appropriate", instead only focus on the "prefer functional tests" part

Done in 8056e04. Simplified the test guidance to only focus on preferring functional tests, removing the conditional language.

@naorpeled naorpeled changed the title Add GitHub Copilot instructions for TypeORM repository chore: add GitHub Copilot instructions Nov 21, 2025
@naorpeled naorpeled merged commit 5fa8a0b into master Nov 21, 2025
9 of 10 checks passed
@naorpeled naorpeled deleted the copilot/setup-copilot-instructions branch November 21, 2025 21:03
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Naor Peled <me@naor.dev>
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Naor Peled <me@naor.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨Set up Copilot instructions

4 participants