Best Practices

A centralized collection of engineering standards, best practices, architectural guidelines, and delivery principles for building scalable, secure, maintainable, and production-ready solutions. This handbook covers software design, system architecture, AI and agentic systems, backend development, cloud platforms, APIs, DevOps, observability, security, testing, and operational excellence across diverse technologies and frameworks.

Backend: Python

Backend: Python

Developer Best Practices Guide

CONTRIBUTING.md

Contributing Guide

This repository follows strict coding, review, testing, and release standards. Every contributor (AI agent) must follow the rules below.


1) Coding Standards

1.1 General rules

1.2 Software engineering principles

1.3 Object-oriented programming

1.4 Design patterns

1.5 Asynchronous programming


2) Project Structure Rules


3) Constants and Messages

Not allowed


raise ValueError("Invalid request")

Preferred


raise ValueError(ErrorMessages.INVALID_REQUEST)


4) Docstrings and Documentation in Code

Minimum expectation


5) Database Rules

5.1 Schema change restrictions

5.2 Documentation requirements for DB objects

5.3 Timestamps

5.4 How DB changes must happen

Any DB update involving the following must happen through Alembic:

5.5 Alembic note


6) Testing Requirements

6.1 Framework

6.2 Coverage

6.3 Test quality expectations


7) Linting and Code Quality Gates

7.1 Pylint

7.2 Command

Run:


run_pylint.bat

7.3 Alembic exception

7.4 Readiness rule

A PR is not ready to merge unless:


8) Versioning and Release File Updates

For every PR, update the following files if the repository/version policy requires it:

Versioning rules

Author metadata


9) Required PR Checklist

Use this checklist before marking the PR ready:


10) AI Agent Instructions

If an AI agent is used to generate or modify code in this repository, it must follow all repository standards defined in this file.

AI agent must do the following

AI agent must never do the following


While not mandatory unless otherwise specified, contributors are encouraged to:

Example commit messages:


fix: handle refresh token expiration in oauth service

feat: add async cloud provider factory implementation

refactor: simplify user onboarding validation flow


12) Quick Reference Summary

Must follow

Must avoid


13) Final Rule

If there is any conflict between convenience and these standards, follow these standards.

Quality, readability, consistency, and reviewability are mandatory for every contribution.

GitHub Repository Best Practices

Guidelines and standard procedures for managing GitHub repositories securely and consistently, including access control, code hygiene, secret handling, branch management, pull request practices, and security alert remediation.

GitHub Repository Best Practices

GitHub Secret Scanning Alert Remediation

Purpose

This SOP is to guide the team on how to review, remediate, and close GitHub secret scanning alerts raised for committed secrets such as passwords, tokens, keys, or connection strings.

Steps to Follow

  1. Go to the GitHub repository

    • Open the impacted repository where the secret scanning alert has been raised.
  2. Open Security section

    • Navigate to Security from the repository menu.
    • Go to Security & Quality if applicable.
  3. Open Secret Scanning

    • Select Secret Scanning.
    • Filter or open the Generic view to see open generic secret findings.
  4. Review the exposed secrets

    • Check all password/secret alerts listed.
    • Identify the impacted file, commit, secret type, and owner/team responsible.
  5. Rotate or validate the secret

    • If the secret is active, rotate/revoke it from the actual source system.
    • Store the new value only in a secure location, such as Azure Key Vault, deployment environment variables, or secure pipeline variables.
    • Do not recommit the new secret in code.
    • Keep screenshot/evidence of rotation or revocation for audit proof.
    • If the secret is already expired or not valid, document the explanation clearly with supporting proof.
  6. Close the secret scanning alert

    • Once remediation is complete, close the alert with the correct reason.
    • Add a clear comment mentioning the action taken, such as rotated, revoked, expired, or no longer valid.
    • Avoid unsupported closure reasons unless approved by the security team.
  7. Update the GitHub issue

    • Go to the Issues tab.
    • Open the security issue created for the repository.
    • Add a resolution comment with the remediation summary and evidence reference.
    • Close the issue after all listed alerts are addressed.
  8. Submit EY security attestation form

    • Fill the EY security form to register the finding as resolved: FORM

Important Notes