Skip to content

Chore/starting golang project#1

Merged
gbrennon merged 20 commits intomainfrom
chore/starting-golang-project
Feb 12, 2026
Merged

Chore/starting golang project#1
gbrennon merged 20 commits intomainfrom
chore/starting-golang-project

Conversation

@gbrennon
Copy link
Copy Markdown
Contributor

No description provided.

Makefile automates common tasks such as:
- testing the codebase
- generating code coverage reports
- enforcing minimum coverage thresholds
- cleaning up generated files
- tagging releases
Including an overview, testing instructions, contributor guidelines and release automation workflow.
Those scripts will be used to automated the release process
@gbrennon gbrennon self-assigned this Feb 10, 2026
Copilot AI review requested due to automatic review settings February 10, 2026 03:55
Copy link
Copy Markdown

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

Initial scaffolding for a Go-based project, including module definition, CI workflows, and release/coverage automation scripts.

Changes:

  • Added Go module configuration (go.mod) and project README.
  • Introduced CI + release GitHub Actions workflows running tests and coverage checks.
  • Added local automation for coverage enforcement and release branching/tagging.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
go.mod Defines the module path and Go language version.
README.md Documents project overview, testing, contributor guidance, and release workflow.
Makefile Adds test, coverage, coverage gate, clean, and tag-release targets.
scripts/release.sh Automates release branch creation, changelog generation, and PR creation.
scripts/next_version.sh Computes the next version from git tags.
.github/workflows/ci.yml Runs tests + coverage gate on pushes/PRs.
.github/workflows/release.yml Runs tests + coverage gate on version tag pushes.
pkg/.gitkeep Keeps pkg/ tracked in git.

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

gbrennon and others added 9 commits February 10, 2026 01:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
release automation should support pre-release like alphama, beta, rc, etc.

This change adds an optional suffix parameter to the `next_version.sh` script and the `release.sh` script, allowing users to specify a suffix for the version being released.

If no suffix is provided, it defaults to a standard patch version bump.
…ocks-org/forging_foundation into chore/starting-golang-project
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gbrennon gbrennon requested a review from Copilot February 12, 2026 00:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gbrennon and others added 3 commits February 11, 2026 21:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ocks-org/forging_foundation into chore/starting-golang-project
Copy link
Copy Markdown

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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.


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

Comment on lines +71 to +76
# Ensure git-chglog configuration exists
if [ ! -f .chglog/config.yml ]; then
echo "Error: git-chglog config file '.chglog/config.yml' not found."
echo "Please add it to the repository or update scripts/release.sh to point to the correct config path."
exit 1
fi
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The script requires .chglog/config.yml, but that directory/file isn't present in the repository currently, so running release.sh will always exit with the error path. Add the .chglog config (and any templates) to the repo, or update the script/README to use the actual config location.

Copilot uses AI. Check for mistakes.

$DRY_RUN || git push origin "$BRANCH"

CHANGELOG_BODY=$($DRY_RUN && echo "[DRY RUN]" || awk '/^## /{flag=1;next}/^$/{flag=0}flag' CHANGELOG.md | awk 'NR>1')
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

head -n -1 is GNU-specific; on macOS/BSD head this errors, which will break release PR creation on developer machines. Consider replacing this with a portable approach (e.g., using sed to drop the last line) or avoid needing to trim with head -n -1.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +32

stdout := os.Stdout
os.Stdout = w

PrintFoo()

w.Close()

os.Stdout = stdout

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This test mutates the global os.Stdout without a defer/t.Cleanup restore, so any early failure (or panic) can leak the redirected stdout into subsequent tests. Also, the pipe fds aren’t consistently closed via defer (e.g., r is never closed). Use t.Cleanup/defer to restore os.Stdout and close both ends of the pipe reliably.

Suggested change
stdout := os.Stdout
os.Stdout = w
PrintFoo()
w.Close()
os.Stdout = stdout
defer func() {
_ = r.Close()
}()
stdout := os.Stdout
os.Stdout = w
t.Cleanup(func() {
os.Stdout = stdout
})
defer func() {
_ = w.Close()
}()
PrintFoo()
w.Close()

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +7
push:
tags:
- 'v*.*.*'

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The documented release flow supports optional suffixes like alpha.1/rc.2, but the release workflow only triggers on tags matching v*.*.* (no prerelease suffix). Either expand the tag trigger to include prerelease patterns or clarify in docs/scripts that prerelease tags won’t run the release workflow.

Copilot uses AI. Check for mistakes.
clean:
rm -f $(COVERAGE_FILE)

release:
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

make release will run even if VERSION is unset, which would try to create/push a v tag. Add a guard that fails with a clear message when VERSION is missing (e.g., require VERSION to be non-empty before tagging).

Suggested change
release:
release:
@if [ -z "$(VERSION)" ]; then \
echo "ERROR: VERSION is not set. Usage: make release VERSION=x.y.z"; \
exit 1; \
fi

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +87
## 🚀 Release Automation

### Prerequisites
- [git-chglog](https://github.com/git-chglog/git-chglog) must be installed for changelog generation.

### Release Workflow

1. **Automate the release process:**
```bash
./scripts/release.sh # Real release flow
./scripts/release.sh --dry-run # Preview actions only (no changes made)
```
This script will:
- Ensure you are on the main branch and up to date
- Determine the next version automatically
- Generate and commit the changelog for the new version
- Create a branch named `release/v<version>` from main
- Push the release branch to the remote
- Open a PR to main with the changelog as the PR body (requires GitHub CLI)

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Release docs mention installing git-chglog but don’t mention that the repo needs a .chglog/config.yml (and possibly templates) for ./scripts/release.sh to work. Either add that config to the repo or update this section to document where the config lives/how to generate it.

Copilot uses AI. Check for mistakes.
@gbrennon gbrennon merged commit 5565068 into main Feb 12, 2026
1 check passed
@gbrennon gbrennon deleted the chore/starting-golang-project branch February 12, 2026 00:43
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.

2 participants