workflows.json•6.65 kB
{
  "schema": "memory_document_v2",
  "metadata": {
    "id": "c2beb74f-caa1-43dd-9ed8-f3201c3c9864",
    "title": "CI/CD Workflows",
    "documentType": "generic",
    "path": "workflows.md",
    "tags": [
      "ci-cd"
    ],
    "lastModified": "2025-03-21T07:21:59.913Z",
    "createdAt": "2025-03-17T02:13:31.718Z",
    "version": 1
  },
  "content": {
    "overview": "This document provides an overview of the CI/CD workflows used in the Memory Bank MCP Server project. These workflows automate various aspects of the development process, from testing and building to deployment and release management.\n",
    "workflow_templates": "Workflow related templates are stored in a dedicated directory to maintain clear separation from application templates:\n**Location**: `.github/workflow-templates/`\n**Purpose**: Strictly for GitHub Actions workflow use\n**Examples**: PR templates for automated workflows like develop-to-master PRs\nApplication templates provided as part of the software functionality remain in the `src/templates/` directory.```\n.github/workflow-templates/\n├── develop-to-master-pr-template.md      # Japanese template\n└── develop-to-master-pr-template-en.md   # English template\nsrc/templates/\n├── pull-request-template.md           # Application template (JP)\n├── pull-request-template-en.md        # Application template (EN)\n├── rules-ja.md                      # Memory bank rules (JP)\n└── rules-en.md                      # Memory bank rules (EN)\n```\nThis separation ensures clear responsibility boundaries and prevents confusion as the project grows.\n",
    "github_actions_workflows": [
      "Our CI/CD pipeline consists of the following GitHub Actions workflows:\n**Purpose**: Runs tests on pull requests and pushes to main branches.\n**Triggers**:\nPull requests to `develop` or `master` branches\nDirect pushes to `develop` or `master` branches\n**Key Features**:\nRuns on multiple Node.js versions (16.x, 18.x, 20.x)\nBuilds the project\nExecutes test suite\n**Usage Notes**:\nAll PRs must pass this workflow before merging\nTest failures block the PR from being merged\n**Purpose**: Automatically creates pull requests from feature/fix branches based on memory bank information.**Triggers**:\nPush to a `feature/*` or `fix/*` branch\nPresence of `pullRequest.md` file in the branch's memory bank\n**Key Features**:\nExtracts PR information from memory bank\nSupports custom titles, target branches, reviewers, and labels\nCreates well-formatted PR with memory bank content\nAutomatically removes `pullRequest.md` after successful PR creation\nWorks with both English and Japanese content\n**Usage Notes**:\nTo trigger this workflow, create a `pullRequest.md` file in your branch's memory bank directory\nUse metadata tags like `#title:`, `#targetBranch:`, `#reviewers:`, and `#labels:` for customization\n**Purpose**: Automatically creates a PR from `develop` to `master` when changes are pushed to `develop`.**Triggers**:\nPush to the `develop` branch\n**Key Features**:\nChecks for existing PRs before creating a new one\nDetermines PR type and labels based on commit messages\nGenerates change log from commit history\nUses language-specific templates based on repository name\nAdds appropriate emoji and labels based on change type\n**Usage Notes**:\nSkips PR creation if an open PR already exists\nCan be skipped by including `[skip ci]` in the commit message\n**Purpose**: Automates the release process when changes are pushed to `master`.**Triggers**:\nPush to the `master` branch\n**Key Features**:\nRuns tests to ensure quality\nBuilds the project\nCreates a Git tag based on `package.json` version\nCreates a GitHub release with auto-generated notes\nPublishes to npm\n**Usage Notes**:\nRequires npm publishing credentials\nCan be skipped by including `[skip ci]` in the commit message\n**Purpose**: Manually increment version numbers.**Triggers**:\nManual workflow dispatch\n**Key Features**:\nSupports patch, minor, and major version bumps\nUpdates `package.json`\nCreates a commit and tag for the new version\n**Usage Notes**:",
      "Run from the GitHub Actions tab",
      "Select bump type (patch, minor, major)",
      "Select target branch (usually `develop`)"
    ],
    "workflow_integration": "The workflows are designed to work together to create a complete CI/CD pipeline:\n1. Developers work on feature/fix branches\n2. Tests run on all PRs to ensure quality\n3. Completed features are merged to `develop`\n4. When ready for release, `develop-to-master-pr.yml` creates a PR to `master`\n5. After review, merging to `master` triggers the release process\n6. Version bumps are performed manually as needed\n",
    "concurrency_control": "Workflows use concurrency controls to prevent simultaneous runs of the same workflow on the same branch, which helps avoid race conditions and resource conflicts.\n```yaml\nconcurrency:\ngroup: ${{ github.workflow }}-${{ github.ref }}\ncancel-in-progress: true\n```\n",
    "best_practices": "When working with these workflows:\n1. **Use conventional commit messages** (e.g., `feat: add new feature` or `fix: resolve bug`) to help with automatic PR categorization and release notes.\n2. **Keep PR templates updated** - The templates in `.github/workflow-templates/` directory are used for GitHub Actions, while templates in `src/templates/` are used for application functionality.\n3. **Include proper test coverage** for new features to ensure the test workflow passes.\n4. **Skip CI when appropriate** by adding `[skip ci]` to commit messages for minor documentation changes or version bumps.\n5. **Check workflow logs** in GitHub Actions tab when troubleshooting CI/CD issues.\n",
    "customizing_workflows": "To modify these workflows:\n1. Edit the corresponding `.yml` file in the `.github/workflows/` directory.\n2. Follow GitHub Actions syntax and best practices.\n3. Update this documentation when making significant changes.\n",
    "troubleshooting": "Common issues and solutions:\n1. **Tests failing** - Check test output for specific failures and fix the underlying code issues.\n2. **Workflow not triggering** - Verify the trigger conditions in the workflow file match your actions.\n3. **Release not publishing** - Ensure npm credentials are properly configured as repository secrets.\n4. **PR creation failing** - Check that the branch memory bank contains the required information.\n",
    "additional_resources": [
      "[GitHub Actions Documentation](https://docs.github.com/en/actions)",
      "[Conventional Commits Specification](https://www.conventionalcommits.org/)"
    ]
  }
}