Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go 1.26.3
- name: Set up Go 1.26.4
uses: actions/setup-go@v6
with:
go-version: '1.26.3'
go-version: '1.26.4'

- name: Build
run: go build -v ./...
Expand All @@ -33,7 +33,7 @@ jobs:
run: go test -p 1 -v ./... -coverprofile="coverage.out"

- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v8.1.0
uses: sonarsource/sonarqube-scan-action@v8.2.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: env.SONAR_TOKEN != ''
Expand All @@ -44,7 +44,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
go-version: ['1.25.10', '1.26.3']
go-version: ['1.25.10', '1.26.4']

steps:
- name: Git checkout
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- name: Get PR details
id: pr
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
const pr = await github.rest.pulls.get({
Expand All @@ -33,10 +33,10 @@ jobs:
ref: ${{ steps.pr.outputs.head_sha }}
fetch-depth: 0

- name: Set up Go 1.26.3
- name: Set up Go 1.26.4
uses: actions/setup-go@v6
with:
go-version: '1.26.3'
go-version: '1.26.4'

- name: Build
run: go build -v ./...
Expand All @@ -50,7 +50,7 @@ jobs:
run: go test -p 1 -v ./... -coverprofile="coverage.out"

- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v8.1.0
uses: sonarsource/sonarqube-scan-action@v8.2.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: env.SONAR_TOKEN != ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
go:
description: 'Go version'
required: true
default: '1.26.3'
default: '1.26.4'
os:
description: 'Operating System (ubuntu-20.04, ubuntu-latest, windows-latest)'
required: true
Expand Down
4 changes: 2 additions & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ func TestBuildContext(t *testing.T) {
Domain: "My Domain",
Options: ContextOptions{
Local: true,
SnapshotLocation: "./tests/snapshots",
SnapshotLocation: "./testdata/snapshots",
},
})

options := client.Context().Options

assert.True(t, options.Local, "expected Local option to be true")
assert.Equal(t, "./tests/snapshots", options.SnapshotLocation, "expected SnapshotLocation to be './tests/snapshots'")
assert.Equal(t, "./testdata/snapshots", options.SnapshotLocation, "expected SnapshotLocation to be './testdata/snapshots'")
})

t.Run("should create fresh default options on rebuild", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion execution_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestExecutionLogger(t *testing.T) {
Options: ContextOptions{
Local: true,
Logger: true,
SnapshotLocation: filepath.Join("tests", "snapshots"),
SnapshotLocation: filepath.Join("testdata", "snapshots"),
},
})

Expand Down
2 changes: 1 addition & 1 deletion local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,5 @@ func useLocalSnapshotFixture(t *testing.T, environment string) {
}

func snapshotFixtureDir() string {
return filepath.Join("tests", "snapshots")
return filepath.Join("testdata", "snapshots")
}
163 changes: 163 additions & 0 deletions testdata/snapshots/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"domain": {
"name": "Business",
"description": "Business description",
"activated": true,
"version": 1,
"group": [
{
"name": "Rollout 2020",
"description": "Changes that will be applied during the rollout",
"activated": true,
"config": [
{
"key": "FF2FOR2020",
"description": "Feature Flag",
"activated": true,
"strategies": [
{
"strategy": "NETWORK_VALIDATION",
"activated": true,
"operation": "EXIST",
"values": [
"10.0.0.3/24"
]
},
{
"strategy": "VALUE_VALIDATION",
"activated": true,
"operation": "NOT_EXIST",
"values": [
"USA",
"Canada",
"Australia",
"Africa"
]
}
],
"components": []
},
{
"key": "FF2FOR2021",
"description": "Strategy disabled",
"activated": true,
"strategies": [
{
"strategy": "NETWORK_VALIDATION",
"activated": false,
"operation": "EXIST",
"values": [
"10.0.0.3/24"
]
}
],
"components": []
},
{
"key": "FF2FOR2022",
"description": "No strategies",
"activated": true,
"components": []
},
{
"key": "FF2FOR2023",
"description": "Feature Flag - Payload Strategy",
"activated": true,
"strategies": [
{
"strategy": "PAYLOAD_VALIDATION",
"activated": true,
"operation": "HAS_ALL",
"values": [
"id",
"user",
"user.login",
"user.role"
]
}
],
"components": []
},
{
"key": "FF2FOR2024",
"description": "reDOS safe test",
"activated": true,
"strategies": [
{
"strategy": "REGEX_VALIDATION",
"activated": true,
"operation": "EXIST",
"values": [
"^(([a-z])+.)+[A-Z]([a-z])+$"
]
}
],
"components": []
}
]
},
{
"name": "Rollout 2030",
"description": "Changes that will be applied during the rollout",
"activated": true,
"config": [
{
"key": "FF2FOR2030",
"description": "Feature Flag",
"activated": true,
"strategies": [],
"components": []
},
{
"key": "FF2FOR2031",
"description": "Feature Flag disabled",
"activated": false,
"strategies": [],
"components": []
}
]
},
{
"name": "Rollout 2040",
"description": "Project is disabled",
"activated": false,
"config": [
{
"key": "FF2FOR2040",
"description": "Feature Flag",
"activated": true,
"strategies": [],
"components": []
}
]
},
{
"name": "Relay test",
"description": "Relay group",
"activated": true,
"config": [
{
"key": "USECASE103",
"description": "Relay enabled",
"activated": true,
"relay": {
"type": "VALIDATOR",
"activated": true
},
"components": []
},
{
"key": "USECASE104",
"description": "Relay disabled",
"relay": {
"type": "VALIDATOR",
"activated": false
},
"activated": true,
"components": []
}
]
}
]
}
}
Loading