Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nobl9/nobl9-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.77.2
Choose a base ref
...
head repository: nobl9/nobl9-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.78.0
Choose a head ref
Loading
Showing with 1,377 additions and 223 deletions.
  1. +3 −3 .github/ISSUE_TEMPLATE/bug_report.md
  2. +1 −1 .github/ISSUE_TEMPLATE/config.yml
  3. +1 −1 .github/ISSUE_TEMPLATE/feature_request.md
  4. +10 −9 .github/pull_request_template.md
  5. +85 −0 .github/release-drafter.yml
  6. +7 −2 .github/renovate.json5
  7. +78 −0 .github/scripts/release-notes.sh
  8. +1 −1 .github/workflows/checks.yml
  9. +13 −0 .github/workflows/pr-title.yml
  10. +37 −0 .github/workflows/release-drafter.yml
  11. +10 −0 .markdownlint.yaml
  12. +5 −5 Makefile
  13. +5 −0 cspell.yaml
  14. +116 −0 docs/DEVELOPMENT.md
  15. +25 −0 docs/RELEASE.md
  16. +6 −5 go.mod
  17. +12 −11 go.sum
  18. +4 −0 internal/serdeutil/doc.go
  19. +31 −0 internal/serdeutil/raw_message.go
  20. +32 −24 internal/validation/README.md
  21. +18 −0 internal/validation/duration.go
  22. +56 −0 internal/validation/duration_test.go
  23. +1 −0 internal/validation/error_codes.go
  24. +1 −0 manifest/kind.go
  25. +47 −40 manifest/kind_enum.go
  26. +5 −3 manifest/v1alpha/agent/agent.go
  27. +1 −15 manifest/v1alpha/alertpolicy/validation.go
  28. +2 −2 manifest/v1alpha/alertpolicy/validation_test.go
  29. +52 −0 manifest/v1alpha/budgetadjustment/budget_adjustment.go
  30. +49 −0 manifest/v1alpha/budgetadjustment/budget_adjustment_object.go
  31. +3 −0 manifest/v1alpha/budgetadjustment/doc.go
  32. +14 −0 manifest/v1alpha/budgetadjustment/example.yaml
  33. +59 −0 manifest/v1alpha/budgetadjustment/example_test.go
  34. +64 −0 manifest/v1alpha/budgetadjustment/validation.go
  35. +262 −0 manifest/v1alpha/budgetadjustment/validation_test.go
  36. +23 −10 manifest/v1alpha/dataexport/data_export.go
  37. +18 −16 manifest/v1alpha/parser/parser.go
  38. +13 −0 manifest/v1alpha/parser/parser_test.go
  39. +2 −2 manifest/v1alpha/slo/metrics_azure_monitor.go
  40. +12 −2 manifest/v1alpha/slo/metrics_azure_monitor_test.go
  41. +3 −13 manifest/v1alpha/slo/metrics_honeycomb.go
  42. +0 −3 manifest/v1alpha/slo/metrics_honeycomb_test.go
  43. +49 −27 manifest/v1alpha/slo/metrics_sumo_logic.go
  44. +118 −16 manifest/v1alpha/slo/metrics_sumo_logic_test.go
  45. +1 −1 manifest/v1alpha/slo/metrics_validation.go
  46. +3 −3 package.json
  47. BIN sdk/config_activity.png
  48. +1 −1 sdk/reader.go
  49. +9 −7 sdk/test_data/client/simple_module/go.mod
  50. +9 −0 sdk/test_data/client/simple_module/go.sum
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a bug report to help us solve the issue
about: Create a bug report to help us solve the issue.
title: "[BUG]"
labels: bug
assignees: ''
@@ -11,12 +11,12 @@ assignees: ''
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior, ideally a minimal working working example `main.go`.
Steps to reproduce the behavior, ideally a minimal working example `main.go`.

**Expected behavior**
A clear and concise description of what you expected to happen.

**System details (please complete the following information):**
**System details (please complete the following information)**
- OS (with version): [e.g. OS X 14.2.1, Ubuntu 22.04]
- SDK Version [e.g. v1.0.2]

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: Nobl9 Support
url: https://www.nobl9.com/contact/support
about: If you need help related to the whole Nobl9 platform or want to problem to remain private, contact us here.
about: If you need help related to the whole Nobl9 platform or want the problem to remain private, contact us here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an idea to help us improve the SDK
about: Suggest an idea to help us improve the SDK.
title: "[FEAT]"
labels: enhancement
assignees: ''
19 changes: 10 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Motivation

Describe what is the motivation behind the proposed changes. If possible reference the current solution/state of affairs.
Describe what is the motivation behind the proposed changes.
If possible reference the current solution/state of affairs.

## Summary

@@ -13,13 +14,13 @@ List related changes from other PRs (if any).
## Testing

- Describe how to check introduced code changes manually. Simple `main.go` which takes advantage of the introduced changes is preferred (if possible and useful).
- Take care of test coverage on unit, integration or even end-to-end tests level.
- Take care of test coverage on unit, integration or even end-to-end levels.

## Checklist
## Release Notes

- [ ] Include this change in Release Notes?
- If yes, write 1-3 sentences about the changes here and explicitly list all changes that can surprise our users.
- [ ] Are these changes required to be in sync with the API? Example of such can be extending a `manifest.Object` with a new field.
It won't be usable until Nobl9 platform version is rolled out which can handle this field.
- If yes, **MUST NOT** create an official release, use a pre-release version, like `v1.1.0-rc1` instead.
- If the changes are independent of Nobl9 platform version, you can release an offical version, like `v1.1.0`.
If this change should be part of the Release Notes,
**replace this entire paragraph** with 1-3 sentences about the changes.
Otherwise, you **MUST** remove this section entirely.

Does this PR contain any breaking changes?
If so, add `## Breaking Changes` header and list the introduced changes there.
85 changes: 85 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: ⚠️ Breaking Changes
labels:
- breaking-change
- title: 🚀 Features
labels:
- enhancement
- title: 💻 Fixed Vulnerabilities
labels:
- security
- title: 🐞 Bug Fixes
labels:
- bug
- title: 🧰 Maintenance
collapse-after: 3
labels:
- chore
- infrastructure
- dependencies
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
autolabeler:
# Pull requests scope.
- label: enhancement
title:
- "/^feat:/i"
- label: chore
title:
- "/^chore:/i"
- label: infrastructure
title:
- "/^infra:/i"
- label: security
title:
- "/^sec:/i"
- label: bug
title:
- "/^fix:/i"
- label: documentation
title:
- "/^doc:/i"
# Version labels.
- label: minor
title:
- "/^feat:/i"
- label: patch
title:
- "/^fix:/i"
- "/^sec:/i"
- "/^chore:/i"
branch:
- '/^renovate_/'
# Languages detection.
- label: go
files:
- '*.go'
- 'go.mod'
- 'go.sum'
- label: python
files:
- '*.py'
- label: javascript
files:
- '*.js'
replacers:
# Remove unlabeled or uncategorized PRs.
- search: "/# What's Changed.*?\\n## /s"
replace: "# What's Changed\n\n## "
template: |
# What's Changed
$CHANGES
9 changes: 7 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
":enableVulnerabilityAlertsWithLabel(security)", // https://docs.renovatebot.com/presets-default/#enablevulnerabilityalertswithlabelarg0
"group:recommended", // https://docs.renovatebot.com/presets-group/#grouprecommended
"workarounds:all", // https://docs.renovatebot.com/presets-workarounds/#workaroundsall
// Automerge configuration.
":automergeMinor",
":automergePr",
":automergeRequireAllStatusChecks",
],
"reviewersFromCodeOwners": true,
"dependencyDashboard": true,
@@ -15,6 +19,9 @@
"rebaseWhen": "conflicted",
"rangeStrategy": "pin",
"branchPrefix": "renovate_",
"commitMessagePrefix": "chore:",
// This will run go mod tidy after each go.mod update.
"postUpdateOptions": ["gomodTidy"],
"packageRules": [
// Groups:
{
@@ -39,8 +46,6 @@
"addLabels": ["javascript"],
},
],
// This will run go mod tidy after each go.mod update.
"postUpdateOptions": ["gomodTidy"],
// Custom version extraction from Makefile.
"regexManagers": [
{
78 changes: 78 additions & 0 deletions .github/scripts/release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash

set -euo pipefail

if [ "$#" -ne 1 ]; then
echo "Provide a single argument with a version of the release draft to use." >&2
echo "Usage: $0 <VERSION>"
exit 1
fi

VERSION="$1"

RELEASE_NOTES=$(gh release view "$VERSION" --json body --jq .body)

BREAKING_CHANGES_HEADER="Breaking Changes"
RELEASE_NOTES_HEADER="Release Notes"

commit_message_re="-\s(.*)\s(\(#[0-9]+\)\s@.*)"
rls_header_re="^##.*(Features|$BREAKING_CHANGES_HEADER|Bug Fixes|Fixed Vulnerabilities)"

extract_header() {
local commit="$1"
local header_name="$2"
awk "
/^\s?$/ {next}
/^## $header_name/ {rn=1}
rn && !/^##/ && !/^--+/ {print};
/^--+/ {rn=0};
/^##/ && !/^## $header_name/ {rn=0}" <<<"$commit"
}

indent() {
while IFS= read -r line; do
printf " %s\n" "${line%"${line##*[![:space:]]}"}"
done <<<"$1"
}

new_notes=""
rls_header=""
while IFS= read -r line; do
new_notes+="$line\n"
if [[ $line == \##* ]]; then
if ! [[ $line =~ $rls_header_re ]]; then
rls_header=""
continue
fi
rls_header="${BASH_REMATCH[1]}"
fi
if [[ $rls_header == "" ]] || [[ $line != -* ]] || [[ $line == *"@renovate"* ]]; then
continue
fi
if ! [[ $line =~ $commit_message_re ]]; then
continue
fi
commit_msg="${BASH_REMATCH[1]}"
commit_body=$(git log -F --grep "$commit_msg" -n1 --pretty="%b")

add_notes() {
local notes="$1"
if [[ $notes != "" ]]; then
new_notes+=$(indent "> $notes")
new_notes+="\n"
fi
}

rn=$(extract_header "$commit_body" "$RELEASE_NOTES_HEADER")
bc=$(extract_header "$commit_body" "$BREAKING_CHANGES_HEADER")

case $rls_header in
"$BREAKING_CHANGES_HEADER") add_notes "$bc" ;;
*) add_notes "$rn" ;;
esac

done <<<"$RELEASE_NOTES"

echo "Uploading release notes for $VERSION"
# shellcheck disable=2059
printf "$new_notes" | gh release edit "$VERSION" --verify-tag -F -
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ jobs:
- name: Set up yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
13 changes: 13 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
pull_request:
types: [opened, reopened, edited, synchronize]
merge_group:
name: pr-title
jobs:
pr-title-check:
runs-on: ubuntu-latest
steps:
- uses: Slashgear/action-check-pr-title@v4.3.0
with:
regexp: "(feat|fix|sec|infra|test|chore|doc): .{5,}"
helpMessage: "Example: 'feat: new pr title check BE-143' <- prefix, colon, space, PR title of at least 5 chars (with ticket number strongly suggested, but not mandatory)"
37 changes: 37 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release Drafter

on:
push:
branches:
- main
# pull_request event is required only for autolabeler
# 'edited' event is required to account for initial invalid PR names
pull_request:
types: [opened, reopened, synchronize, edited]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_LABELER_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
# Drafts your next Release notes as Pull Requests are merged into "main"
- id: drafter
uses: release-drafter/release-drafter@v6
- name: Add release notes to the draft
if: github.event_name == 'push'
run: .github/scripts/release-notes.sh ${{ steps.drafter.outputs.tag_name }}
10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MD010:
code_blocks: false
spaces_per_tab: 1
MD013:
line_length: 80
heading_line_length: 80
code_block_line_length: 120
code_blocks: true
MD024:
siblings_only: true
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@ BIN_DIR := ./bin
# renovate datasource=github-releases depName=abice/go-enum
GO_ENUM_VERSION := v0.6.0
# renovate datasource=github-releases depName=securego/gosec
GOSEC_VERSION := v2.18.2
GOSEC_VERSION := v2.19.0
# renovate datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION := v1.55.2
GOLANGCI_LINT_VERSION := v1.56.0
# renovate datasource=go depName=golang.org/x/vuln/cmd/govulncheck
GOVULNCHECK_VERSION := v1.0.1
GOVULNCHECK_VERSION := v1.0.4
# renovate datasource=go depName=golang.org/x/tools/cmd/goimports
GOIMPORTS_VERSION := v0.16.1
GOIMPORTS_VERSION := v0.18.0

# Check if the program is present in $PATH and install otherwise.
# ${1} - oneOf{binary,yarn}
@@ -81,7 +81,7 @@ check/trailing:
check/markdown:
$(call _print_check_step,Verifying Markdown files)
$(call _ensure_installed,yarn,markdownlint)
yarn --silent markdownlint '*.md' --disable MD010 # MD010 does not handle code blocks well.
yarn --silent markdownlint '**/*.md' --ignore node_modules

## Check for potential vulnerabilities across all Go dependencies.
check/vulns:
5 changes: 5 additions & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ words:
- auseg9kiegwketjzc416
- authdata
- awsiam
- budgetadjustment
- byday
- clientcreds
- codeowners
- consumergroup
@@ -98,7 +100,9 @@ words:
- rolebinding
- rollup
- rollups
- rrule
- rtmp
- serdeutil
- serviceruntime
- slis
- sloctl
@@ -111,6 +115,7 @@ words:
- stimeslice
- strconv
- structs
- submatches
- sumologic
- testutils
- timeseries
Loading