Skip to content

Conversation

@xbglowx
Copy link
Member

@xbglowx xbglowx commented Dec 22, 2025

No description provided.

- Rename main.yaml to build.yaml
- Replace custom prep script with docker/metadata-action
- Remove paths-ignore (not needed for tag-based releases)
- Add semver tags (v1.0.0, v1.0, v1)
- Add sha tag for traceability
@xbglowx xbglowx requested a review from Copilot December 22, 2025 17:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Mailgun API client from v3 to v5 and introduces comprehensive testing infrastructure with mocks, along with modernizing the CI/CD pipeline using release-please for automated releases.

Key Changes:

  • Upgraded mailgun-go dependency from v3 to v5, requiring API usage refactoring
  • Added dependency injection through a MailgunClient interface to enable testing with mocks
  • Implemented comprehensive test suite with 95%+ code coverage using mockery-generated mocks
  • Replaced manual GitHub Actions workflow with release-please automation

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Updated mailgun-go to v5.9.0 and added testify for testing
main.go Refactored to use MailgunClient interface and v5 API methods
mailgun_client.go New file implementing MailgunClient interface wrapping v5 API
mocks/mock_mailgun_client.go Generated mock implementation for testing
exporter_test.go Comprehensive test suite covering success and error scenarios
release-please-config.json Configuration for automated release management
.release-please-manifest.json Current version tracking for release-please
.mockery.yaml Configuration for mock generation
Makefile Added test and generate targets
.github/workflows/build-publish.yaml New unified workflow for builds, tests, and releases
.github/workflows/create-release.yaml Workflow for automated release PR creation
.github/workflows/main.yaml Removed old workflow file
.vscode/settings.json Added empty VS Code settings file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add MailgunClient interface to enable mocking
- Create mailgun_client.go with interface and wrapper implementation
- Generate mocks with mockery v3
- Add comprehensive tests for Exporter:
  - TestNewExporterWithClient
  - TestExporter_Describe
  - TestExporter_Collect_Success
  - TestExporter_Collect_GetDomainsError
  - TestExporter_Collect_GetMetricsError
  - TestExporter_Collect_DomainState
  - TestExporter_Collect_NilMetricValues
- add test job and Makefile targets
  - Add 'make test' target (runs fmt check + go test)
  - Add 'make generate' target (runs mockery)
  - Add test job to CI that runs before binary builds
BREAKING CHANGE: MG_DOMAIN environment variable is no longer required.
The exporter now uses the new ListMetrics API instead of the deprecated
GetStats API. All Prometheus metrics remain unchanged.
@xbglowx xbglowx merged commit 2e386e1 into main Dec 22, 2025
4 checks passed
@xbglowx xbglowx deleted the holiday-goodies branch December 22, 2025 17:52
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.

1 participant