Skip to content

Commit

Permalink
base 4 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nareshmmr committed Nov 26, 2024
1 parent 1080fb6 commit fb2682c
Show file tree
Hide file tree
Showing 20 changed files with 533 additions and 146 deletions.
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,38 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: '/lib'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
- package-ecosystem: gomod
directory: '/wasp'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
- package-ecosystem: gomod
directory: '/seth'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
- package-ecosystem: gomod
directory: '/havoc'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
- package-ecosystem: gomod
directory: '/k8s-test-runner'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- 'dependencies'
68 changes: 0 additions & 68 deletions .github/workflows/dependabot-consumers-summary.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/release-tools.yaml

This file was deleted.

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

Steps to release:

- 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)
- 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
- If there are accidental breaking changes, and it is possible to make them backward compatible - fix them
- If there are breaking changes, and we must release them change `go.mod` path, add prefix `/vX`, merge your PR(s)
- 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
- Tag `main` branch in format `$pkg/$subpkg/vX.X.X` according to your changes and push it, example:
```
git tag $pkg/$subpkg/v1.1.0 && git push --tags
git tag $pkg/$subpkg/v1.1.1 && git push --tags
git tag $pkg/$subpkg/v2.0.0 && git push --tags
```
```
git tag $pkg/$subpkg/v1.1.0 && git push --tags
git tag $pkg/$subpkg/v1.1.1 && git push --tags
git tag $pkg/$subpkg/v2.0.0 && git push --tags
```
- Check the [release page](https://github.com/goplugin/plugin-testing-framework/releases)
- 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)

### Binary releases

If your module have `cmd/main.go` we build binary automatically for various platforms and attach it to the release page.

## Debugging release pipeline and `gorelease` tool

Checkout `dummy-release-branch` and release it:

- `git tag dummy-module/v0.X.0`
- Add `vX.X.X.md` in `.changeset`
- `git push --no-verify --force && git push --tags`
- Check [releases](https://github.com/goplugin/plugin-testing-framework/releases)

Pipelines:

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

## Check breaking changes locally

We have a simple wrapper to check breaking changes for all the packages. Commit all your changes and run:

```
go run ./tools/breakingchanges/cmd/main.go
go run ./tools/breakingchanges/cmd/main.go --subdir wasp # check recursively starting with subdir
go run ./tools/breakingchanges/cmd/main.go --ignore tools,wasp,havoc,seth # to ignore some packages
```
```
1 change: 1 addition & 0 deletions havoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/rs/zerolog v1.33.0
//github.com/goplugin/plugin-testing-framework/lib/grafana v1.50.0
github.com/goplugin/plugin-testing-framework/lib/grafana v0.1.1 //plugin update changes
k8s.io/api v0.31.0
k8s.io/client-go v0.31.0
sigs.k8s.io/controller-runtime v0.16.2
)
Expand Down
1 change: 1 addition & 0 deletions lib/.changeset/v1.50.10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added Loki client to query logs data + tests, see usage here - [README](../../README.md)
30 changes: 30 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,33 @@ export RESTY_DEBUG=true
## Using AWS Secrets Manager

Check the [docs](SECRETS.md)

## Loki Client

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.

### Debugging Resty and Loki Client

```bash
export LOKI_CLIENT_LOG_LEVEL=info
export RESTY_DEBUG=true
```

### Example usage:

```go
auth := LokiBasicAuth{
Username: os.Getenv("LOKI_LOGIN"),
Password: os.Getenv("LOKI_PASSWORD"),
}

queryParams := LokiQueryParams{
Query: `{namespace="test"} |= "test"`,
StartTime: time.Now().AddDate(0, 0, -1),
EndTime: time.Now(),
Limit: 100,
}

lokiClient := NewLokiClient("https://loki.api.url", "my-tenant", auth, queryParams)
logEntries, err := lokiClient.QueryLogs(context.Background())
```
Loading

0 comments on commit fb2682c

Please sign in to comment.