Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 9, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides GitHub Copilot coding agents with detailed instructions on how to work effectively in the defang-github-action repository.

What's Included

The instructions provide a complete guide for developers working with this GitHub Action repository, covering:

  • Repository structure and key files explanation
  • Validated testing commands for the Node.js test application and Docker containers
  • Exact timing expectations with explicit "NEVER CANCEL" warnings for builds
  • Manual validation scenarios that test real functionality end-to-end
  • Development workflow from fresh checkout to testing and validation
  • Troubleshooting guide for common issues like rate limits and port conflicts

Comprehensive Testing

Every command in the instructions has been manually validated:

# Node.js test application
cd test
export PORT=3000 DEFANG_GH_ACTION_TEST_MESSAGE="Hello from test"
node index.js  # ✅ Validated working

# Docker build and run
docker build -t test-app .  # ✅ Takes ~20 seconds, works with caching
docker run --rm -p 3001:3000 -e PORT=3000 -e DEFANG_GH_ACTION_TEST_MESSAGE="Docker test" test-app  # ✅ Validated

# Docker Compose testing
docker compose up -d  # ✅ Validated with proper environment variables

Key Features

  • Imperative tone throughout ("Run this command", "Do not do that")
  • Exhaustive validation - all commands tested and verified to work
  • Timing documentation with appropriate timeout recommendations
  • Real-world scenarios that mirror the CI/CD workflow patterns
  • No build requirements clearly documented (composite action using shell scripts)

The instructions start with a firm directive to follow the documented commands first before falling back to additional searches, ensuring consistent and reliable development workflows.

Fixes #25.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/DefangLabs/defang/releases/latest
    • Triggering command: curl -fsSL REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


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

Co-authored-by: lionello <591860+lionello@users.noreply.github.com>
Copilot AI changed the title [WIP] ✨ Set up Copilot instructions Add comprehensive GitHub Copilot instructions for defang-github-action Sep 9, 2025
Copilot AI requested a review from lionello September 9, 2025 03:10
Comment on lines +15 to +41
### Testing the Action
- Run the test Node.js application:
```bash
cd test
export PORT=3000
export DEFANG_GH_ACTION_TEST_MESSAGE="Hello from test"
node index.js
# Test with: curl http://localhost:3000
```

- Build and test the Docker container:
```bash
cd test
docker build -t test-app . # Takes ~20 seconds for initial build, use cached layers after
docker run --rm -d -p 3001:3000 -e PORT=3000 -e DEFANG_GH_ACTION_TEST_MESSAGE="Hello from Docker" test-app
# Test with: curl http://localhost:3001
docker stop $(docker ps -q --filter ancestor=test-app)
```

- Test with Docker Compose:
```bash
cd test
docker compose up -d # Uses cached image if already built
# Test with: curl http://localhost:3000
docker compose down
```

Copy link
Member

Choose a reason for hiding this comment

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

This is not related to this action. It's just a random containerized for this action's test in GH Action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Set up Copilot instructions

2 participants