Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 18, 2025

This PR implements a GitHub workflow to help the Copilot coding agent understand how to set up the development environment for the FerretDB/wire project.

Changes Made

  • Added .github/workflows/copilot-setup-steps.yml with a single copilot-setup-steps job
  • Included all essential development environment setup steps:
    • Go environment setup using the project's custom GitHub action
    • Development tools installation (Task, linters, code generators)
    • Project dependency initialization
    • Code generation and formatting
    • Basic setup verification

Implementation Details

The workflow follows the exact same patterns as the existing go.yml workflow to ensure consistency:

  • Uses FerretDB/github-actions/setup-go@main (same as existing workflows)
  • Uses the same Task-based build system commands
  • Includes the same tool installation and initialization steps
  • Provides clear, descriptive step names for better Copilot understanding

This allows the GitHub Copilot coding agent to understand the development setup process for this Go-based MongoDB wire protocol implementation project, including its specific toolchain requirements and build system.

Fixes #149.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

codecov bot commented Jul 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.06%. Comparing base (712828f) to head (39107dd).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #150   +/-   ##
=======================================
  Coverage   60.06%   60.06%           
=======================================
  Files          44       44           
  Lines        2935     2935           
=======================================
  Hits         1763     1763           
  Misses        927      927           
  Partials      245      245           
Flag Coverage Δ
test 60.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +8 to +32
name: Setup development environment for Copilot coding agent
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: copilot-setup

- name: Install Task and tools
run: go generate -x
working-directory: tools

- name: Initialize project dependencies
run: bin/task init

- name: Run code generators and formatters
run: bin/task gen

- name: Verify setup with short tests
run: bin/task test-short No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 months ago

To address the issue, add an explicit permissions block to the workflow. Since the workflow involves checking out code and running local tasks, it only needs read access to the repository contents and does not require write permissions. The permissions block should be added at the workflow level (root) to apply the least privilege configuration to all jobs within the workflow.


Suggested changeset 1
.github/workflows/copilot-setup-steps.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
--- a/.github/workflows/copilot-setup-steps.yml
+++ b/.github/workflows/copilot-setup-steps.yml
@@ -1,5 +1,7 @@
 ---
 name: Copilot Setup Steps
+permissions:
+  contents: read
 
 on: workflow_dispatch
 
EOF
@@ -1,5 +1,7 @@
---
name: Copilot Setup Steps
permissions:
contents: read

on: workflow_dispatch

Copilot is powered by AI and may make mistakes. Always verify output.
@Copilot Copilot AI changed the title [WIP] Customizing the development environment for Copilot coding agent Add GitHub Copilot agent setup workflow Jul 18, 2025
@Copilot Copilot AI requested a review from AlekSi July 18, 2025 14:46
Copilot finished work on behalf of AlekSi July 18, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Customizing the development environment for Copilot coding agent
2 participants