From d561ff656bafca3e665870111e5c65afc5c7c062 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 06:49:16 +0000 Subject: [PATCH 1/4] Initial plan From 4e6503bc1ce36ea2861c8c14a38f77aebe8b14fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 06:51:28 +0000 Subject: [PATCH 2/4] Add GitHub Copilot instructions for PR status checks Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com> --- .github/copilot-instructions.md | 89 +++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..0b5f67e0 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,89 @@ +# GitHub Copilot Instructions for MOC Repository + +## Pull Request Workflow + +### Before Marking PR as Ready for Review + +When creating or working on a pull request, you **MUST** ensure all of the following conditions are met before marking the PR as ready for review: + +#### 1. Build Status Checks +- ✅ All build jobs must pass successfully +- ✅ Azure Pipelines build jobs must complete without errors: + - `Build` job (includes protobuf generation, compilation, and unit tests) + - `Lint` job (GolangCI-Lint must pass) +- ✅ GitHub Actions workflows must complete successfully: + - CodeQL analysis must complete without blocking issues + +#### 2. Test Status Checks +- ✅ All unit tests must pass (`make unittest`) +- ✅ No test failures or regressions introduced by the changes +- ✅ Test coverage should be maintained or improved + +#### 3. Code Quality Checks +- ✅ Linting must pass without errors (`make golangci-lint`) +- ✅ No new linting violations introduced by the changes +- ✅ Code follows the existing style and conventions of the repository + +#### 4. CI/CD Pipeline Status +- ✅ All Azure Pipelines jobs must show green/passing status +- ✅ All GitHub Actions workflows must show green/passing status +- ✅ No pending or failing status checks on the PR + +#### 5. Build Verification +- ✅ The code must build successfully: + - `make generate` completes without errors (protobuf generation) + - `make all` completes without errors (full build) +- ✅ No compilation errors or warnings that would block the build + +### How to Verify Status + +Before marking a PR as ready for review, use GitHub CLI or API to verify: + +```bash +# Check PR status checks +gh pr checks + +# Verify all checks are passing +gh pr view --json statusCheckRollup +``` + +Or check the PR page on GitHub to ensure: +- All status checks show green checkmarks (✓) +- No red X marks or orange/yellow pending indicators +- The "All checks have passed" message is displayed + +### Exception Handling + +If any checks fail: +1. **DO NOT** mark the PR as ready for review +2. Investigate and fix the failing checks first +3. Wait for all checks to re-run and pass +4. Only then mark the PR as ready for review + +If a check failure is unrelated to your changes: +1. Document the pre-existing failure in the PR description +2. Ensure your changes don't make it worse +3. Consider fixing the pre-existing issue if feasible +4. Communicate with maintainers about the unrelated failure + +### Draft PR Usage + +- Use draft PRs for work-in-progress changes +- Keep PR in draft status until all checks pass +- Convert to ready for review only after all status checks are green + +## Build Commands Reference + +- `make generate` - Generate protobuf files +- `make all` - Build all components +- `make unittest` - Run unit tests +- `make golangci-lint` - Run linting checks +- `make pipeline` - Generate protobuf for pipeline + +## Additional Guidelines + +- Always run local builds and tests before pushing +- Ensure changes are minimal and focused +- Keep PR descriptions clear and informative +- Update documentation if behavior changes +- Follow existing code patterns and conventions From c205b7c48c67182138171339e83a11658cee4b45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 06:52:57 +0000 Subject: [PATCH 3/4] Fix build command descriptions based on actual Makefile Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com> --- .github/copilot-instructions.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0b5f67e0..7471f7d8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -31,8 +31,8 @@ When creating or working on a pull request, you **MUST** ensure all of the follo #### 5. Build Verification - ✅ The code must build successfully: - - `make generate` completes without errors (protobuf generation) - - `make all` completes without errors (full build) + - `make pipeline` completes without errors (protobuf generation for pipeline) + - `make all` completes without errors (format code and run tests) - ✅ No compilation errors or warnings that would block the build ### How to Verify Status @@ -74,11 +74,14 @@ If a check failure is unrelated to your changes: ## Build Commands Reference -- `make generate` - Generate protobuf files -- `make all` - Build all components +- `make generate` - Generate protobuf files (bootstrap and run gen.sh) +- `make pipeline` - Generate protobuf for pipeline (bootstrap and run gen.sh -c) +- `make all` - Format code and run tests +- `make format` - Format code with gofmt +- `make test` - Run all tests (calls unittest) - `make unittest` - Run unit tests - `make golangci-lint` - Run linting checks -- `make pipeline` - Generate protobuf for pipeline +- `make tidy` - Tidy go modules ## Additional Guidelines From aa6b2b74e0c83d9e4c16d43e1248b7ef55300174 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 06:54:01 +0000 Subject: [PATCH 4/4] Update build command descriptions for accuracy Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com> --- .github/copilot-instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7471f7d8..cf3d2713 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -74,8 +74,8 @@ If a check failure is unrelated to your changes: ## Build Commands Reference -- `make generate` - Generate protobuf files (bootstrap and run gen.sh) -- `make pipeline` - Generate protobuf for pipeline (bootstrap and run gen.sh -c) +- `make generate` - Generate protobuf files (calls ./gen.sh) +- `make pipeline` - Generate protobuf for pipeline (calls ./gen.sh -c) - `make all` - Format code and run tests - `make format` - Format code with gofmt - `make test` - Run all tests (calls unittest)