3 feature add doublestar demo#4
Conversation
sinlov
commented
Mar 24, 2026
- feat(ci): Update CI workflow configuration and add double star pattern matching test
- docs: Add contribution guidelines and code of conduct documents
- 在ci.yml中添加手动触发功能和更详细的分支过滤规则 - 更新golang-ci.yml添加测试覆盖率、基准测试等可选功能 - 升级Go版本至1.23并在构建时注入buildID - 更新部署工作流支持dry run模式和改进artifact下载 - 添加doublestar模式匹配库的单元测试 - 重构Makefile工具脚本并添加buildID支持 - 更新各种GitHub Action依赖到最新版本
- 新增英文版贡献指南(CONTRIBUTING.md)和行为准则(CODE_OF_CONDUCT.md) - 新增中文版贡献指南和行为准则文档 - 添加多个Issue模板,包括bug报告、功能请求、文档改进等 - 配置dependabot自动化依赖更新 - 更新README.md添加贡献相关链接和说明 - 添加pull request模板
- 将go-release-platform.yml中的Go版本从1.23更新到1.24 - 将golang-ci.yml中的Go版本矩阵从1.23更新到1.24 - 将golang-codecov.yml中的Go版本从1.23更新到1.24 - 将goreleaser-golang.yml中的Go版本从1.23.8更新到1.24.0
- 将 golangci-lint 版本从 latest 改为 2.11.3 - 避免因版本不稳定导致的 CI 构建失败
- 将 golangci-lint 版本从 latest 改为 2.11.3 - 避免因版本不稳定导致的 CI 构建失败
- 添加 github.com/go-vgo/robotgo 到忽略路径列表 - 保持现有代码风格和配置结构不变
- 添加 robot_demo.go 文件到排除路径 - 配置 generated 文件分析模式为 strict - 设置 exclusions 规则针对 robot_demo.go 的 typecheck linter - 移除无效的注释内容 - 更新 exclusions 部分的路径配置格式
- 注释掉 golangci-lint 步骤避免代码检查失败 - 保留测试基准运行步骤确保性能监控正常
- 将 run_golangci_lint 默认值从 true 更改为 false - 启用 golangci-lint 检查步骤并添加条件判断 - 移除 golangci-lint 步骤的注释状态 - 保持基准测试步骤的条件执行逻辑
- 将 run_golangci_lint 参数设置为 false - 保持其他 CI 流程配置不变
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s build/test/release automation (Make + GitHub Actions), introduces a doublestar pattern-matching demo test, and adds community contribution documents/templates.
Changes:
- Refactors Makefile utilities (go test/mod/list/doc/dist) with new target naming and additional CI-friendly tasks.
- Updates GitHub Actions CI workflows (Go version, reusable workflows, Codecov, GoReleaser, tag release flow).
- Adds
doublestardemo tests plus new repo hygiene files (CONTRIBUTING/CODE_OF_CONDUCT, issue templates, PR template, Dependabot).
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| z-MakefileUtils/go-test.mk | Renames/expands Go test targets, adds clean/update/coverage helpers. |
| z-MakefileUtils/go-test-integration.mk | Renames integration test targets and coverage-reporting helpers. |
| z-MakefileUtils/go-mod.mk | Adds go.mod maintenance tasks (verify/tidy/vendor/lint helpers). |
| z-MakefileUtils/go-list.mk | Adds go list/install/build helper targets. |
| z-MakefileUtils/go-doc.mk | Adds local godoc/golds helpers and export target. |
| z-MakefileUtils/go-dist.mk | Updates dist packaging/build flags and adds extra metadata outputs. |
| z-MakefileUtils/MakeGoMod.mk | Removes legacy go mod make utilities (replaced by go-mod.mk). |
| z-MakefileUtils/MakeGoList.mk | Removes legacy go list make utilities (replaced by go-list.mk). |
| z-MakefileUtils/MakeDocker.mk | Adds .PHONY declarations to docker helper targets. |
| z-MakefileUtils/MakeBasicEnv.mk | Enhances CI-derived version/mark computation and adds env help targets. |
| util/worker_pool/SimpleWorkPool_test.go | Minor test formatting/structure adjustment. |
| libdemo/doublestar/doublestar_test.go | Adds demo tests for doublestar.Match and include/exclude-style matching. |
| go.sum | Updates dependency checksums after module updates/additions. |
| go.mod | Bumps Go version and updates/adds dependencies (incl. doublestar, testify, robotgo). |
| README.md | Adds contributing section with links to new docs. |
| Makefile | Reworks targets/includes, adds go-doc include, renames clean/dev/run targets, adds CI aggregates. |
| .goreleaser.yml | Introduces GoReleaser v2 config for building/archiving artifacts. |
| .golangci-v2.yaml | Adds golangci-lint v2 configuration. |
| .github/workflows/version.yml | Updates action versions and prints additional run metadata. |
| .github/workflows/goreleaser-golang.yml | Adds reusable GoReleaser workflow (dry-run/build/release + artifact upload). |
| .github/workflows/golang-codecov.yml | Changes Codecov workflow triggers and updates actions/Go version. |
| .github/workflows/golang-ci.yml | Adds inputs to control testing/lint/bench/coverage; updates actions/Go versions. |
| .github/workflows/go-release-platform.yml | Fixes inputs, updates Go version/actions, injects build ID into ldflags, uploads artifacts. |
| .github/workflows/deploy-tag.yml | Adds dry-run option, updates actions, improves artifact download patterning and release publishing. |
| .github/workflows/ci.yml | Expands branch patterns, adds GoReleaser dry-run and tag-based release flow wiring. |
| .github/pull_request_template.md | Adds PR checklist template. |
| .github/dependabot.yml | Enables monthly GitHub Actions dependency updates. |
| .github/ISSUE_TEMPLATE/question.yml | Adds question issue form template. |
| .github/ISSUE_TEMPLATE/help_wanted.yml | Adds help-wanted issue form template. |
| .github/ISSUE_TEMPLATE/good_first_issue.md | Adds good-first-issue template. |
| .github/ISSUE_TEMPLATE/feature_request.yml | Adds feature request issue form template. |
| .github/ISSUE_TEMPLATE/documentation.yml | Adds documentation issue form template. |
| .github/ISSUE_TEMPLATE/bug_report.yml | Adds bug report issue form template. |
| .github/CONTRIBUTING_DOC/zh-CN/CONTRIBUTING.md | Adds Chinese contributing guide. |
| .github/CONTRIBUTING_DOC/zh-CN/CODE_OF_CONDUCT.md | Adds Chinese code of conduct. |
| .github/CONTRIBUTING_DOC/CONTRIBUTING.md | Adds contributing guide. |
| .github/CONTRIBUTING_DOC/CODE_OF_CONDUCT.md | Adds code of conduct. |
Comments suppressed due to low confidence (3)
z-MakefileUtils/go-dist.mk:103
- This build macro injects
-X main.buildID=..., but there is nomain.buildIDsymbol in the repository. This will make alldist*targets fail at link time unless avar buildID stringis added topackage main(or the ldflags are adjusted).
z-MakefileUtils/go-dist.mk:66 - The Windows source copy command uses single-quoted strings containing backslashes:
cp -R 'doc\' .... In POSIX shells,'doc\'is an unterminated single-quoted string, so this will fail to parse. Use a valid path/quoting style for Windows shells (or avoid single quotes here).
z-MakefileUtils/go-test.mk:120 test.go.coverage.htmlwrites${ENV_GO_TEST_COVERAGE_HTML_OUT}under${ENV_PATH_INFO_ROOT_DIST}, but it no longer depends onpathCheckRootDist. If the dist directory doesn't exist,go tool cover -o ...will fail. AddpathCheckRootDistas a prerequisite (as done in the integration coverage HTML target).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @echo "go list -mod readonly -m -versions github.com/gin-gonic/gin | awk '{print \044\061 \042 lastest: \042 \044\0116\0106 }'" | ||
| @echo "" | ||
| ifeq ($(OS),Windows_NT) | ||
| @go list -mod mod -m -versions github.com/stretchr/testify | ||
| else | ||
| @echo "last version" | ||
| @go list -mod mod -m -versions github.com/stretchr/testify | awk '{print $$1 " lastest: " $$NF }' | ||
| endif |
There was a problem hiding this comment.
The echoed output uses the misspelling lastest (should be latest). This is user-facing output and also appears in the awk formatting string.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| - name: Download Artifact | ||
| uses: actions/download-artifact@v3 | ||
| uses: actions/download-artifact@v7 | ||
| if: ${{ inputs.download_artifact_name != null }} | ||
| with: | ||
| name: ${{inputs.download_artifact_name}} | ||
| path: ${{ github.workspace }}/dist | ||
| ## https://github.com/actions/download-artifact/tree/v4?tab=readme-ov-file#breaking-changes | ||
| pattern: ${{ inputs.download_artifact_name }}-${{ inputs.tag_name }}* | ||
| merge-multiple: true |
There was a problem hiding this comment.
if: ${{ inputs.download_artifact_name != null }} will be true for the default empty string, so this step will run even when no artifact name is intended. Use an explicit non-empty check (e.g. inputs.download_artifact_name != '') to avoid downloading with an empty pattern.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| @echo " build out path: ${1}" | ||
| @echo " build entrance: ${2}" | ||
| @echo " buildID: ${3}" | ||
| go build -ldflags "-X main.buildID=${3}" -o ${1} ${2} |
There was a problem hiding this comment.
go build -ldflags "-X main.buildID=..." will fail because there is no main.buildID symbol in the codebase (search found no buildID/BuildID). Either add a var buildID string (and other injected vars) to package main, or remove this -X flag from the build macro.
| go build -ldflags "-X main.buildID=${3}" -o ${1} ${2} | |
| go build -o ${1} ${2} |
| .PHONY go.doc.install: | ||
| go.doc.install: | ||
| @echo "install godoc" |
There was a problem hiding this comment.
.PHONY declarations are malformed (e.g. .PHONY go.doc.install:). GNU Make expects .PHONY: <targets>. As written, these lines won't mark the targets phony and may create/override a .PHONY target unexpectedly.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| - -X main.version={{ .Version }} | ||
| - -X main.rawVersion={{ .RawVersion }} | ||
| - -X main.buildID={{ .ShortCommit }} | ||
| - -X main.commit={{ .FullCommit }} | ||
| - -X main.date={{ .Date }} |
There was a problem hiding this comment.
This GoReleaser config injects several ldflags (main.version, main.rawVersion, main.buildID, main.commit, main.date), but none of these symbols exist in the codebase. Go builds run by GoReleaser will fail at link time unless these variables are defined in package main (or the ldflags are removed/updated).
| - -X main.version={{ .Version }} | |
| - -X main.rawVersion={{ .RawVersion }} | |
| - -X main.buildID={{ .ShortCommit }} | |
| - -X main.commit={{ .FullCommit }} | |
| - -X main.date={{ .Date }} |
| @@ -37,50 +59,55 @@ jobs: | |||
| - name: Run go build | |||
| run: go build -v -tags test ./... | |||
There was a problem hiding this comment.
This workflow runs go build -tags test ./..., but the command package cmd/GoLang-PlayGround has //go:build !test on its only non-test source file, so the package has no buildable files under the test tag and go build will fail. Either remove -tags test from this build step, or add a //go:build test non-test stub main file for CI builds.
| run: go build -v -tags test ./... | |
| run: go build -v ./... |
There was a problem hiding this comment.
@copilot ignore this, keep -tags test for only run unit test
There was a problem hiding this comment.
Understood — keeping -tags test on the build step as-is. No changes made.
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: sinlov <3433415+sinlov@users.noreply.github.com> Agent-Logs-Url: https://github.com/sinlov/GoLang-PlayGround/sessions/53dc9dbc-3cd8-4aac-8465-efdf04630632
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fix: correct 'lastest' typo to 'latest' in go-mod.mk output
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 37 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
z-MakefileUtils/go-dist.mk:67
- In the Windows tar helper,
cp -R 'doc\' ...uses a literal backslash in the source path. In POSIX shells / MSYS environments this refers to a directory literally nameddoc\(notdoc/), so the copy will fail even whendoc/exists. Use a forward-slash path for the source (doc/) and only normalize path separators on the destination if needed.
z-MakefileUtils/go-test.mk:120 test.go.coverage.htmlgenerates an output file under${ENV_PATH_INFO_ROOT_DIST}and requires${ENV_GO_TEST_COVERAGE_PROFILE}to exist, but it currently has no prerequisites. This can fail when the dist directory hasn't been created or coverage hasn't been generated yet. Make this target depend ontest.go.coverageandpathCheckRootDist(or create the output directory in the recipe).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: upload-artifact | ||
| uses: actions/upload-artifact@v6 | ||
| if: ${{ inputs.upload_artifact_name != null || ! inputs.dry_run }} | ||
| with: | ||
| name: ${{ inputs.upload_artifact_name }}-${{ inputs.version_name }}-${{ github.run_id }}-${{ github.run_attempt }} | ||
| retention-days: 5 | ||
| overwrite: true | ||
| if-no-files-found: error |
There was a problem hiding this comment.
The upload step condition inputs.upload_artifact_name != null || ! inputs.dry_run is true when upload_artifact_name is the default empty string, so this step will run (and can fail due to if-no-files-found: error) even when no artifact upload is intended. Gate this step on a non-empty artifact name, or set if-no-files-found to warn for dry-runs.
| .PHONY: go.list.install | ||
| go.list.install: | ||
| go get -t -v ./... |
There was a problem hiding this comment.
go.list.install runs go get -t -v ./..., which can modify go.mod/go.sum (and go get is not intended as an install mechanism in modern Go). If the goal is to ensure deps are present for builds/tests, prefer go mod download (or go test ./... which will resolve deps) to avoid unintended module upgrades.
| $(info -> change ENV_DIST_MARK by DRONE_TAG) | ||
| ENV_DIST_MARK=-tag.${DRONE_TAG} | ||
| ENV_DIST_VERSION=${DRONE_TAG} | ||
| ENV_DIST_MARK=-tag.${CI_COMMIT_SHA} |
There was a problem hiding this comment.
In the DRONE_TAG branch, ENV_DIST_MARK is set using CI_COMMIT_SHA. On Drone this variable is typically unset, which can produce a malformed mark (e.g. "-tag.") and loses the Drone commit reference. Use DRONE_COMMIT/DRONE_COMMIT_SHA (or the same variable family as the surrounding Drone logic) when DRONE_TAG is present.
| ENV_DIST_MARK=-tag.${CI_COMMIT_SHA} | |
| ENV_DIST_MARK=-tag.${DRONE_COMMIT} |
| .PHONY: envHelp | ||
| envBasic: | ||
| @echo ------- start show env basic--------- |
There was a problem hiding this comment.
.PHONY: envHelp is declared immediately before defining envBasic, so envBasic is not marked phony while envHelp is redundantly declared twice. Update the .PHONY line here to include envBasic (and keep a single .PHONY for envHelp).