Skip to content

Commit fb2682c

Browse files
author
nareshmmr
committed
base 4 commit
1 parent 1080fb6 commit fb2682c

File tree

20 files changed

+533
-146
lines changed

20 files changed

+533
-146
lines changed

.github/dependabot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,38 @@ updates:
1010
schedule:
1111
interval: daily
1212
open-pull-requests-limit: 10
13+
- package-ecosystem: gomod
14+
directory: '/lib'
15+
schedule:
16+
interval: weekly
17+
open-pull-requests-limit: 10
18+
labels:
19+
- 'dependencies'
20+
- package-ecosystem: gomod
21+
directory: '/wasp'
22+
schedule:
23+
interval: weekly
24+
open-pull-requests-limit: 10
25+
labels:
26+
- 'dependencies'
27+
- package-ecosystem: gomod
28+
directory: '/seth'
29+
schedule:
30+
interval: weekly
31+
open-pull-requests-limit: 10
32+
labels:
33+
- 'dependencies'
34+
- package-ecosystem: gomod
35+
directory: '/havoc'
36+
schedule:
37+
interval: weekly
38+
open-pull-requests-limit: 10
39+
labels:
40+
- 'dependencies'
41+
- package-ecosystem: gomod
42+
directory: '/k8s-test-runner'
43+
schedule:
44+
interval: weekly
45+
open-pull-requests-limit: 10
46+
labels:
47+
- 'dependencies'

.github/workflows/dependabot-consumers-summary.yaml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/release-tools.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

RELEASE.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,44 @@ Use only [lightweight tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
99
**Do not move tags between commits. If something need to be fixed increment patch or minor version.**
1010

1111
Steps to release:
12+
1213
- When all your PRs are merged to `main` check the `main` branch [breaking changes badge](https://github.com/goplugin/plugin-testing-framework/actions/workflows/rc-breaking-changes.yaml)
1314
- If there are no breaking changes for external methods, create a branch and explain all your module changes in `vX.X.X.md` committed under `.changeset` dir in your module. If changes are really short, and you run the [script](#check-breaking-changes-locally) locally you can push `.changeset` as a part of your final feature PR
1415
- If there are accidental breaking changes, and it is possible to make them backward compatible - fix them
1516
- If there are breaking changes, and we must release them change `go.mod` path, add prefix `/vX`, merge your PR(s)
1617
- When all the changes are merged, and there are no breaking changes in the [pipeline](https://github.com/goplugin/plugin-testing-framework/actions/workflows/rc-breaking-changes.yaml) then proceed with releasing
1718
- Tag `main` branch in format `$pkg/$subpkg/vX.X.X` according to your changes and push it, example:
18-
```
19-
git tag $pkg/$subpkg/v1.1.0 && git push --tags
20-
git tag $pkg/$subpkg/v1.1.1 && git push --tags
21-
git tag $pkg/$subpkg/v2.0.0 && git push --tags
22-
```
19+
```
20+
git tag $pkg/$subpkg/v1.1.0 && git push --tags
21+
git tag $pkg/$subpkg/v1.1.1 && git push --tags
22+
git tag $pkg/$subpkg/v2.0.0 && git push --tags
23+
```
2324
- Check the [release page](https://github.com/goplugin/plugin-testing-framework/releases)
24-
- To check how dependency changes can affect other repositories check dependabot [summary pipeline](https://github.com/goplugin/plugin-testing-framework/actions/workflows/dependabot-consumers-summary.yaml)
2525

2626
### Binary releases
27+
2728
If your module have `cmd/main.go` we build binary automatically for various platforms and attach it to the release page.
2829

2930
## Debugging release pipeline and `gorelease` tool
31+
3032
Checkout `dummy-release-branch` and release it:
33+
3134
- `git tag dummy-module/v0.X.0`
3235
- Add `vX.X.X.md` in `.changeset`
3336
- `git push --no-verify --force && git push --tags`
3437
- Check [releases](https://github.com/goplugin/plugin-testing-framework/releases)
3538

3639
Pipelines:
40+
3741
- [Main branch breaking changes](https://github.com/goplugin/plugin-testing-framework/actions/workflows/rc-breaking-changes.yaml)
3842
- [Pipeline for releasing Go modules](.github/workflows/release-go-module.yml)
39-
- [Dependabot summary pipeline](.github/workflows/dependabot-consumers-summary.yaml)
4043

4144
## Check breaking changes locally
45+
4246
We have a simple wrapper to check breaking changes for all the packages. Commit all your changes and run:
47+
4348
```
4449
go run ./tools/breakingchanges/cmd/main.go
4550
go run ./tools/breakingchanges/cmd/main.go --subdir wasp # check recursively starting with subdir
4651
go run ./tools/breakingchanges/cmd/main.go --ignore tools,wasp,havoc,seth # to ignore some packages
47-
```
52+
```

havoc/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/rs/zerolog v1.33.0
1111
//github.com/goplugin/plugin-testing-framework/lib/grafana v1.50.0
1212
github.com/goplugin/plugin-testing-framework/lib/grafana v0.1.1 //plugin update changes
13+
k8s.io/api v0.31.0
1314
k8s.io/client-go v0.31.0
1415
sigs.k8s.io/controller-runtime v0.16.2
1516
)

lib/.changeset/v1.50.10.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Added Loki client to query logs data + tests, see usage here - [README](../../README.md)

lib/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,3 +430,33 @@ export RESTY_DEBUG=true
430430
## Using AWS Secrets Manager
431431

432432
Check the [docs](SECRETS.md)
433+
434+
## Loki Client
435+
436+
The `LokiClient` allows you to easily query Loki logs from your tests. It supports basic authentication, custom queries, and can be configured for (Resty) debug mode.
437+
438+
### Debugging Resty and Loki Client
439+
440+
```bash
441+
export LOKI_CLIENT_LOG_LEVEL=info
442+
export RESTY_DEBUG=true
443+
```
444+
445+
### Example usage:
446+
447+
```go
448+
auth := LokiBasicAuth{
449+
Username: os.Getenv("LOKI_LOGIN"),
450+
Password: os.Getenv("LOKI_PASSWORD"),
451+
}
452+
453+
queryParams := LokiQueryParams{
454+
Query: `{namespace="test"} |= "test"`,
455+
StartTime: time.Now().AddDate(0, 0, -1),
456+
EndTime: time.Now(),
457+
Limit: 100,
458+
}
459+
460+
lokiClient := NewLokiClient("https://loki.api.url", "my-tenant", auth, queryParams)
461+
logEntries, err := lokiClient.QueryLogs(context.Background())
462+
```

0 commit comments

Comments
 (0)