Skip to content

3 feature add doublestar demo#4

Open
sinlov wants to merge 17 commits into
mainfrom
3-feature-add-doublestar-demo
Open

3 feature add doublestar demo#4
sinlov wants to merge 17 commits into
mainfrom
3-feature-add-doublestar-demo

Conversation

@sinlov

@sinlov sinlov commented Mar 24, 2026

Copy link
Copy Markdown
Owner
  • feat(ci): Update CI workflow configuration and add double star pattern matching test
  • docs: Add contribution guidelines and code of conduct documents

sinlov added 2 commits March 24, 2026 16:12
- 在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模板
@sinlov sinlov self-assigned this Mar 24, 2026
@sinlov sinlov linked an issue Mar 24, 2026 that may be closed by this pull request
sinlov added 8 commits March 24, 2026 16:26
- 将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 流程配置不变

Copilot AI left a comment

Copy link
Copy Markdown

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 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 doublestar demo 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 no main.buildID symbol in the repository. This will make all dist* targets fail at link time unless a var buildID string is added to package 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.html writes ${ENV_GO_TEST_COVERAGE_HTML_OUT} under ${ENV_PATH_INFO_ROOT_DIST}, but it no longer depends on pathCheckRootDist. If the dist directory doesn't exist, go tool cover -o ... will fail. Add pathCheckRootDist as a prerequisite (as done in the integration coverage HTML target).

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

Comment thread z-MakefileUtils/MakeBasicEnv.mk Outdated
Comment thread z-MakefileUtils/go-mod.mk Outdated
Comment on lines +26 to +33
@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

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

The echoed output uses the misspelling lastest (should be latest). This is user-facing output and also appears in the awk formatting string.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment thread .github/workflows/go-release-platform.yml Outdated
Comment on lines 56 to +63
- 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

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment thread z-MakefileUtils/MakeDocker.mk Outdated
Comment thread Makefile Outdated
Comment thread Makefile
@echo " build out path: ${1}"
@echo " build entrance: ${2}"
@echo " buildID: ${3}"
go build -ldflags "-X main.buildID=${3}" -o ${1} ${2}

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
go build -ldflags "-X main.buildID=${3}" -o ${1} ${2}
go build -o ${1} ${2}

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot keep this for buildId inject

Comment thread z-MakefileUtils/go-doc.mk
Comment on lines +17 to +19
.PHONY go.doc.install:
go.doc.install:
@echo "install godoc"

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

.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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment thread .goreleaser.yml
Comment on lines +15 to +19
- -X main.version={{ .Version }}
- -X main.rawVersion={{ .RawVersion }}
- -X main.buildID={{ .ShortCommit }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Date }}

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Suggested change
- -X main.version={{ .Version }}
- -X main.rawVersion={{ .RawVersion }}
- -X main.buildID={{ .ShortCommit }}
- -X main.commit={{ .FullCommit }}
- -X main.date={{ .Date }}

Copilot uses AI. Check for mistakes.
@@ -37,50 +59,55 @@ jobs:
- name: Run go build
run: go build -v -tags test ./...

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
run: go build -v -tags test ./...
run: go build -v ./...

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot ignore this, keep -tags test for only run unit test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood — keeping -tags test on the build step as-is. No changes made.

sinlov and others added 2 commits March 25, 2026 10:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown

@sinlov I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

sinlov and others added 5 commits March 25, 2026 10:50
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>
fix: correct 'lastest' typo to 'latest' in go-mod.mk output

Copilot AI left a comment

Copy link
Copy Markdown

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 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 named doc\ (not doc/), so the copy will fail even when doc/ 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.html generates 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 on test.go.coverage and pathCheckRootDist (or create the output directory in the recipe).

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

Comment on lines +174 to +181
- 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

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
.PHONY: go.list.install
go.list.install:
go get -t -v ./...

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
$(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}

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
ENV_DIST_MARK=-tag.${CI_COMMIT_SHA}
ENV_DIST_MARK=-tag.${DRONE_COMMIT}

Copilot uses AI. Check for mistakes.
Comment on lines +107 to 109
.PHONY: envHelp
envBasic:
@echo ------- start show env basic---------

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

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

.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).

Copilot uses AI. Check for mistakes.
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.

[feature] add doublestar demo

3 participants