Skip to content

Commit 855c916

Browse files
committed
fix: correcting some non-deterministic tests and docs
1 parent f4fb178 commit 855c916

File tree

12 files changed

+216
-16
lines changed

12 files changed

+216
-16
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Description
2+
3+
Please describe _what does this Pull Request fix or add?_.
4+
5+
Information that is useful here:
6+
7+
* **The What**: What is your change doing?
8+
* **The Why**: Why is the change necessary? What is the use case?
9+
* **Type of change**
10+
**Examples:**
11+
* Bugfix
12+
* New feature
13+
* Code Quality Improvement
14+
* Dependency Upgrade
15+
* Documentation
16+
* **Breaking change**: Yes or no? Backward compatible?
17+
* **Related to an issue**: Does this fix or close an issue?
18+
19+
## Examples
20+
21+
Let us know how users can use or test this functionality.
22+
23+
```go
24+
// Example code
25+
```
26+
27+
## Checklist
28+
29+
* [ ] Documentation
30+
* [ ] Code
31+
* [ ] Updated README or /docs/
32+
* [ ] Unit or Integration tests added
33+
* [ ] Good Path
34+
* [ ] Error Path
35+
* [ ] Commits follow conventions described here:
36+
* [ ] [Conventional Commits 1.0.0](https://conventionalcommits.org/en/v1.0.0-beta.4/#summary)
37+
* [ ] [The seven rules of a great Git commit message](https://chris.beams.io/posts/git-commit/#seven-rules)
38+
* [ ] Commits are squashed such that
39+
* [ ] There is 1 commit per isolated change
40+
* [ ] I've not made extraneous commits/changes that are unrelated to my change.
41+
* [ ] I have read the [contributing guide][]
42+
43+
[contributing guide]: https://github.com/devnw/.github/blob/main/CONTRIBUTING.md

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ cd canary
3535
make build
3636
```
3737

38+
## Repository
39+
40+
The code is hosted on GitHub:
41+
42+
- Repository: [Github](https://github.com/devnw/canary)
43+
- Code Ref: [pkg.go.dev](https://pkg.go.dev/go.devnw.com/canary)
44+
3845
### Initialize Your Project
3946

4047
```bash
@@ -545,11 +552,11 @@ We welcome contributions! Please:
545552
5. Update documentation with DOC= fields
546553
6. Verify before submitting: `canary scan --verify GAP_ANALYSIS.md`
547554

548-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
555+
See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for detailed guidelines.
549556

550557
## License
551558

552-
Licensed under the terms found in [LICENSE](LICENSE).
559+
Licensed under the terms found in [LICENSE](https://github.com/devnw/canary/blob/main/LICENSE).
553560

554561
## Acknowledgments
555562

docs/CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Community Code of Conduct v1.0
2+
3+
This is Code of Conduct is based on the [CNCF Code of
4+
Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
5+
See the referred document for translated versions into different languages.
6+
7+
## Contributor Code of Conduct
8+
9+
As contributors and maintainers of this project, and in the interest of fostering
10+
an open and welcoming community, we pledge to respect all people who contribute
11+
through reporting issues, posting feature requests, updating documentation,
12+
submitting pull requests or patches, and other activities.
13+
14+
We are committed to making participation in this project a harassment-free
15+
experience for everyone, regardless of level of experience, gender, gender
16+
identity and expression, sexual orientation, disability, personal appearance,
17+
body size, race, ethnicity, age, religion, or nationality.
18+
19+
Examples of unacceptable behavior by participants include:
20+
21+
* The use of sexualized language or imagery
22+
* Personal attacks
23+
* Trolling or insulting/derogatory comments
24+
* Public or private harassment
25+
* Publishing others' private information, such as physical or electronic addresses,
26+
without explicit permission
27+
* Other unethical or unprofessional conduct.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject
30+
comments, commits, code, wiki edits, issues, and other contributions that are not
31+
aligned to this Code of Conduct. By adopting this Code of Conduct, project
32+
maintainers commit themselves to fairly and consistently applying these
33+
principles to every aspect of managing this project. Project maintainers who do
34+
not follow or enforce the Code of Conduct may be permanently removed from the
35+
project team.
36+
37+
This code of conduct applies both within project spaces and in public spaces
38+
when an individual is representing the project or its community.
39+
40+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
41+
reported by contacting the project maintainers or [Benji Vesterby](https://github.com/benjivesterby)
42+
directly via email [benji@devnw.com](mailto:benji@devnw.com).
43+
44+
This Code of Conduct is adapted from the Contributor Covenant
45+
(<http://contributor-covenant.org>), version 1.2.0, available at
46+
<http://contributor-covenant.org/version/1/2/0/>

docs/CONTRIBUTING.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributing
2+
3+
We'd love to accept your patches and contributions to this project through the
4+
process of creating a [pull request][https://github.com/devnw/canary] (**PR**). This document details the
5+
process of submitting a PR so that it can be reviewed and merged into the
6+
codebase. It also contains some guidelines for writing good commits, reporting
7+
issues, and guidelines for project maintainers.
8+
9+
---
10+
11+
## Reporting issues
12+
13+
Bugs, feature requests, and development-related questions should be directed to
14+
the specific project's issue tracker or discussion board.
15+
16+
### Bugs
17+
18+
If reporting a bug, please submit an issue and provide as much context as
19+
possible such as your operating system, architecture, library release version,
20+
Go version (if applicable), and anything else that might be relevant to the bug.
21+
22+
Fill out as much information as possible in the form provided by the issue
23+
template.
24+
25+
#### SECURITY BUGS
26+
27+
We take security bugs ***VERY*** seriously!
28+
29+
Please promptly report security related bugs to <security@devnw.com>. Please
30+
follow [responsible disclosure guidelines][SECURITY.md] when publicizing any security related
31+
information, ensuring that maintainers are aware of the issue and are able to
32+
address it promptly.
33+
34+
Please include:
35+
36+
1. Information about the vulnerability
37+
1. Associated CVEs (if any)
38+
1. Affected release(s)
39+
1. Affected package(s)
40+
41+
### Feature Requests
42+
43+
For feature requests, please explain what you're trying to do, and
44+
how the requested feature would help you do that.
45+
46+
Security related bugs can either be reported in the issue tracker, or if they
47+
are more sensitive, emailed to <security@devnw.com>.
48+
49+
[responsible disclosure guidelines]: https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html
50+
51+
---
52+
53+
## Submitting a Pull Request
54+
55+
1. It's generally best to start by opening a new issue describing the bug or
56+
feature you're intending to fix. Even if you think it's relatively minor,
57+
it's helpful to know what people are working on. Mention in the initial
58+
issue that you are planning to work on that bug or feature so that it can
59+
be assigned to you.
60+
61+
1. Follow the normal process of [forking][https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo] the project, and setup a new
62+
branch to work in. It's important that each group of changes be done in
63+
separate branches in order to ensure that a pull request only includes the
64+
commits related to that bug or feature.
65+
66+
1. This project uses `nix` and `direnv` to manage development environments.
67+
Please ensure you have both installed and configured on your system.
68+
See the [development environment documentation](./DEVELOPMENT.md) for more
69+
information.
70+
---
71+
72+
## Maintainer's Guide
73+
74+
(These notes are mostly only for people merging in pull requests.)
75+
76+
It is the responsibility of the maintainer to ensure that the code is passing
77+
all checks and tests. The maintainer should also ensure that the code is
78+
consistent with the project's [code style][] and [documentation][]. The
79+
maintainer should also ensure that the code is well-documented and tested
80+
before merging in a pull request.
81+
82+
[git-aliases]: https://github.com/willnorris/dotfiles/blob/d640d010c23b1116bdb3d4dc12088ed26120d87d/git/.gitconfig#L13-L15
83+
[rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491
84+
[modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046

docs/DEVELOPMENT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Development Environment Setup
2+
3+
TBD

docs/SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SECURITY
2+
3+
We take security bugs ***VERY*** seriously!
4+
5+
Please promptly report security related bugs to <security@devnw.com>. Please
6+
follow [responsible disclosure guidelines][] when publicizing any security related
7+
information, ensuring that maintainers are aware of the issue and are able to
8+
address it promptly.
9+
10+
Please include:
11+
12+
1. Information about the vulnerability
13+
1. Associated CVEs (if any)
14+
1. Affected release(s)
15+
1. Affected package(s)
16+
17+
[responsible disclosure guidelines]: https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package main
77

8-
// CANARY: REQ=CBIN-101; FEATURE="ScannerCore"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_101_Engine_ScanBasic; BENCH=BenchmarkCANARY_CBIN_101_Engine_Scan; OWNER=canary; UPDATED=2025-09-20
8+
// CANARY: REQ=CBIN-101; FEATURE="ScannerCore"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_101_Engine_ScanBasic; BENCH=BenchmarkCANARY_CBIN_101_Engine_Scan; OWNER=canary; UPDATED=2025-10-15
99
import (
1010
"encoding/json"
1111
"flag"

scan_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313

1414
func TestAcceptance_ParseAndSummarizeFixture_WithPromotion(t *testing.T) {
1515
dir := t.TempDir()
16-
mustWrite(t, filepath.Join(dir, "file1.zig"), `// CANARY: REQ=REQ-GQL-042; FEATURE="CDC/Streaming"; ASPECT=API; STATUS=STUB; TEST=tests/e2e_cdc.zig:TestCANARY_REQ_GQL_042_StartStop; OWNER=streaming; UPDATED=2025-09-20`)
17-
mustWrite(t, filepath.Join(dir, "file2.go"), `// CANARY: REQ=REQ-GQL-046; FEATURE="TDE"; ASPECT=Storage; STATUS=IMPL; TEST=TestCANARY_REQ_GQL_046_KeyRotate; OWNER=security; UPDATED=2025-09-20`)
16+
mustWrite(t, filepath.Join(dir, "file1.zig"), `// CANARY: REQ=REQ-GQL-042; FEATURE="CDC/Streaming"; ASPECT=API; STATUS=STUB; TEST=tests/e2e_cdc.zig:TestCANARY_REQ_GQL_042_StartStop; OWNER=streaming; UPDATED=2025-10-15`)
17+
mustWrite(t, filepath.Join(dir, "file2.go"), `// CANARY: REQ=REQ-GQL-046; FEATURE="TDE"; ASPECT=Storage; STATUS=IMPL; TEST=TestCANARY_REQ_GQL_046_KeyRotate; OWNER=security; UPDATED=2025-10-15`)
1818

1919
rep, err := Scan(dir)
2020
if err != nil {
@@ -35,7 +35,7 @@ func TestAcceptance_ParseAndSummarizeFixture_WithPromotion(t *testing.T) {
3535

3636
func TestAcceptance_PromotionToBenched(t *testing.T) {
3737
dir := t.TempDir()
38-
mustWrite(t, filepath.Join(dir, "file3.zig"), `// CANARY: REQ=REQ-GQL-050; FEATURE="RecursiveQuery"; ASPECT=Planner; STATUS=IMPL; BENCH=BenchmarkCANARY_REQ_GQL_050_RecursivePerf; UPDATED=2025-09-20`)
38+
mustWrite(t, filepath.Join(dir, "file3.zig"), `// CANARY: REQ=REQ-GQL-050; FEATURE="RecursiveQuery"; ASPECT=Planner; STATUS=IMPL; BENCH=BenchmarkCANARY_REQ_GQL_050_RecursivePerf; UPDATED=2025-10-15`)
3939
rep, err := Scan(dir)
4040
if err != nil {
4141
t.Fatalf("scan: %v", err)
@@ -53,7 +53,7 @@ func TestAcceptance_VerifyFailsOnOverclaim(t *testing.T) {
5353

5454
// repo with only STUB marker
5555
dir := t.TempDir()
56-
mustWrite(t, filepath.Join(dir, "cdc.zig"), `// CANARY: REQ=REQ-GQL-042; FEATURE="CDC"; ASPECT=API; STATUS=STUB; UPDATED=2025-09-20`)
56+
mustWrite(t, filepath.Join(dir, "cdc.zig"), `// CANARY: REQ=REQ-GQL-042; FEATURE="CDC"; ASPECT=API; STATUS=STUB; UPDATED=2025-10-15`)
5757

5858
rep, _ := Scan(dir)
5959
claims, _ := ParseGAPClaims(p)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package test
2-
// CANARY: REQ=CBIN-001; FEATURE="StaleToken"; ASPECT=API; STATUS=TESTED; TEST=Test1; UPDATED=2025-10-19
2+
// CANARY: REQ=CBIN-001; FEATURE="StaleToken"; ASPECT=API; STATUS=TESTED; TEST=Test1; UPDATED=2025-10-20
33
// CANARY: REQ=CBIN-002; FEATURE="FreshToken"; ASPECT=CLI; STATUS=TESTED; TEST=Test2; UPDATED=2025-10-15
44
// CANARY: REQ=CBIN-003; FEATURE="StaleImplNotUpdated"; ASPECT=Engine; STATUS=IMPL; UPDATED=2024-01-01
5-
// CANARY: REQ=CBIN-004; FEATURE="StaleBenchedToken"; ASPECT=Storage; STATUS=BENCHED; BENCH=Bench4; UPDATED=2025-10-19
5+
// CANARY: REQ=CBIN-004; FEATURE="StaleBenchedToken"; ASPECT=Storage; STATUS=BENCHED; BENCH=Bench4; UPDATED=2025-10-20

tools/canary/main_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ func TestCANARY_CBIN_101_Engine_ScanBasic(t *testing.T) {
2424
dir := t.TempDir()
2525
fixtures := map[string]string{
2626
"file1.go": `package p
27-
// CANARY: REQ=CBIN-200; FEATURE="Alpha"; ASPECT=API; STATUS=STUB; UPDATED=2025-09-20
27+
// CANARY: REQ=CBIN-200; FEATURE="Alpha"; ASPECT=API; STATUS=STUB; UPDATED=2025-10-15
2828
`,
2929
"file2.go": `package p
30-
// CANARY: REQ=CBIN-201; FEATURE="Bravo"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-09-20
30+
// CANARY: REQ=CBIN-201; FEATURE="Bravo"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-10-15
3131
`,
3232
"file3.go": `package p
33-
// CANARY: REQ=CBIN-202; FEATURE="Charlie"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-09-20
33+
// CANARY: REQ=CBIN-202; FEATURE="Charlie"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-15
3434
`,
3535
}
3636
for name, content := range fixtures {
@@ -77,7 +77,7 @@ func setupFixture(tb testing.TB, numFiles int) string {
7777
dir := tb.TempDir()
7878
for i := 0; i < numFiles; i++ {
7979
content := fmt.Sprintf(`package p
80-
// CANARY: REQ=CBIN-%03d; FEATURE="Feature%d"; ASPECT=API; STATUS=IMPL; UPDATED=2025-09-20
80+
// CANARY: REQ=CBIN-%03d; FEATURE="Feature%d"; ASPECT=API; STATUS=IMPL; UPDATED=2025-10-15
8181
`, i, i)
8282
if err := os.WriteFile(filepath.Join(dir, fmt.Sprintf("file%d.go", i)), []byte(content), 0o644); err != nil {
8383
tb.Fatal(err)

0 commit comments

Comments
 (0)