Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into proj/linodego_v2.0 #675

Merged
merged 47 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d464398
Support missing domain-related endpoints for API parity (#620)
yec-akamai Nov 22, 2024
87775e1
test: Update default test image to reflect the deprecation of Debian …
ykim-akamai Nov 25, 2024
90fe250
Added support for updated Reserved IP behavior to existing resources …
AniJ98 Nov 25, 2024
663eb17
build(deps): bump github.com/go-resty/resty/v2 from 2.16.1 to 2.16.2 …
dependabot[bot] Nov 25, 2024
bb8fd62
build(deps): bump slackapi/slack-github-action from 1.27.0 to 2.0.0 (…
dependabot[bot] Nov 26, 2024
d291aac
doc: Remove Image Services Gen2 LA notice (#628)
yec-akamai Nov 27, 2024
59c1d54
build(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#…
dependabot[bot] Nov 28, 2024
60096dd
build(deps): bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 (#608)
dependabot[bot] Nov 28, 2024
9b3c337
build(deps): bump golang.org/x/net from 0.30.0 to 0.31.0 (#614)
dependabot[bot] Nov 28, 2024
6106012
doc: add info for kubeconfig as base64 (#607)
guilhem Nov 28, 2024
95e95bd
Added support for missing User-related fields (#622)
ezilber-akamai Dec 2, 2024
7212ba9
Add hardware type and linode label fields to volume struct (#604)
zliang-akamai Dec 4, 2024
19bf0e3
build(deps): bump golang.org/x/text from 0.20.0 to 0.21.0 (#638)
dependabot[bot] Dec 6, 2024
94c3d40
build(deps): bump golang.org/x/net from 0.31.0 to 0.32.0 (#637)
dependabot[bot] Dec 6, 2024
55f9fb9
Updated migrations field to be pointer (#639)
ezilber-akamai Dec 6, 2024
34a1e5c
Added support for missing Service Transfer related endpoints (#632)
ezilber-akamai Dec 9, 2024
00343d6
Added support for missing Obj-related endpoints (#634)
ezilber-akamai Dec 9, 2024
6b41317
add account test coverage (#636)
ykim-akamai Dec 9, 2024
fefcd3e
new: Introduce UpdateIPAddressV2; deprecate UpdateIPAddress (#641)
lgarber-akamai Dec 13, 2024
5fc5868
Add advanced CodeQL and dependencies review workflows (#640)
zliang-akamai Dec 16, 2024
aee0bb2
NewClient panics if http.client is nil and LINODE_CA is set (#635)
kokes Dec 20, 2024
857b24b
build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 (#646)
dependabot[bot] Dec 27, 2024
9633762
Support DBaaS V2.0 (#633)
ezilber-akamai Jan 7, 2025
3804294
build(deps): bump golang.org/x/net from 0.33.0 to 0.34.0 (#650)
dependabot[bot] Jan 8, 2025
c4bc912
build(deps): bump golang.org/x/oauth2 from 0.24.0 to 0.25.0 (#648)
dependabot[bot] Jan 9, 2025
c613763
Remove unnecessary permissions (#643)
zliang-akamai Jan 9, 2025
2520ae9
Add unit test coverage for Type, Vlan and Tag related methods/functi…
vshanthe Jan 10, 2025
1cfb144
VPU Support (#645)
jriddle-linode Jan 10, 2025
a3aa5be
Support `tier` field for LKE-E (#651)
ezilber-akamai Jan 13, 2025
7b7ba1d
build(deps): bump github.com/go-resty/resty/v2 from 2.16.2 to 2.16.3 …
dependabot[bot] Jan 13, 2025
9193012
Add support for object storage services gen2 (#649)
zliang-akamai Jan 15, 2025
fcf4b18
rfc: doPOSTRequestNoResponseBody (#654)
zliang-akamai Jan 15, 2025
a8748fc
Add unit test coverage for Stackscripts, Database and Region related …
vshanthe Jan 22, 2025
7d14d5c
test/workflow: Update make test commands and related workflows (#657)
ykim-akamai Jan 28, 2025
a010140
Added missign db-related fields (#659)
ezilber-akamai Jan 29, 2025
c5883b6
remove unnecessary TEST_ARGS (#664)
ykim-akamai Jan 29, 2025
daab234
build(deps): bump github.com/go-resty/resty/v2 from 2.16.3 to 2.16.5 …
dependabot[bot] Jan 30, 2025
2d64121
Checking for DefaultTransport in NewClient (#663)
kokes Jan 31, 2025
78fa5ac
Add unit test coverage for Volume,Volume types and Longview related …
vshanthe Feb 4, 2025
72f6203
Reformatted endpoint functions to simplify them (#668)
ezilber-akamai Feb 4, 2025
0fd46b0
add domain and domain record unit test coverage (#656)
ykim-akamai Feb 5, 2025
635a017
build(deps): bump crazy-max/ghaction-github-labeler from 5.1.0 to 5.2…
dependabot[bot] Feb 6, 2025
544f0ee
build(deps): bump golang.org/x/oauth2 from 0.25.0 to 0.26.0 (#672)
dependabot[bot] Feb 7, 2025
a1d5a13
remove deprecated Cluster variable in tests (#666)
ykim-akamai Feb 7, 2025
c5cc32a
Allow to enable LKE APL (#665)
yec-akamai Feb 7, 2025
26ec1d6
Merge main into project branch
ezilber-akamai Feb 10, 2025
89dc37d
Ran make tidy
ezilber-akamai Feb 10, 2025
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
89 changes: 30 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
python-version: '3.x'

- name: Install Python deps
run: pip3 install requests wheel boto3
run: pip3 install requests wheel boto3==1.35.99

- name: Install go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest
Expand Down Expand Up @@ -80,66 +80,37 @@ jobs:

notify-slack:
runs-on: ubuntu-latest
needs: [test]
if: ${{ (success() || failure()) && github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'linode/linodego' }} # Run even if integration tests fail and only on main repository
needs: [ test ]
if: ${{ (success() || failure()) && github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'linode/linodego' }}

steps:
- name: Notify Slack
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ needs.test.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
- type: divider
- type: section
fields:
- type: mrkdwn
text: "*Build Result:*\n${{ needs.test.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
- type: mrkdwn
text: "*Branch:*\n`${{ github.ref_name }}`"
- type: section
fields:
- type: mrkdwn
text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
- type: mrkdwn
text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
- type: divider
- type: context
elements:
- type: mrkdwn
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "dev", "main", "proj/*" ]
pull_request:
branches: [ "dev", "main", "proj/*" ]
schedule:
- cron: '39 0 * * 6'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@b54af0c25861143e7c8813d7cbbf46d2c341680c
uses: crazy-max/ghaction-github-labeler@31674a3852a9074f2086abcf1c53839d466a47e7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
Expand Down
85 changes: 28 additions & 57 deletions .github/workflows/nightly_smoke_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,67 +32,38 @@ jobs:
- name: Run smoke tests
id: smoke_tests
run: |
make smoketest
make test-smoke
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}

- name: Notify Slack
if: (success() || failure()) && github.repository == 'linode/linodego'
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
- type: divider
- type: section
fields:
- type: mrkdwn
text: "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
- type: mrkdwn
text: "*Branch:*\n`${{ github.ref_name }}`"
- type: section
fields:
- type: mrkdwn
text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
- type: mrkdwn
text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
- type: divider
- type: context
elements:
- type: mrkdwn
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
2 changes: 1 addition & 1 deletion .github/workflows/release-cross-repo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:

- name: run tests
run: |
make int-test
make test-int
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}
25 changes: 9 additions & 16 deletions .github/workflows/release-notify-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Notify Slack - Main Message
id: main_message
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New Release Published: _linodego_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: "*New Release Published: _linodego_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
name: Gosec Scan
name: Security Checks for Pull Requests
on:
pull_request: null

jobs:
dependency-review:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: on-failure

gosec_scan:
runs-on: ubuntu-latest
env:
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ PACKAGES := $(shell go list ./... | grep -v integration)

SKIP_LINT ?= 0

.PHONY: build vet test refresh-fixtures clean clean-cov clean-fixtures lint run_fixtures sanitize fixtures godoc testint testunit testcov tidy
.PHONY: build vet test refresh-fixtures clean clean-cov clean-fixtures lint run_fixtures sanitize fixtures godoc test-int test-unit test-smoke testcov tidy

test: build lint testunit testint
test: build lint test-unit test-int

citest: lint test

testunit:
go test -v $(PACKAGES) $(ARGS)
cd test && make testunit
test-unit:
go test -v $(PACKAGES) $(TEST_ARGS)
cd test && make test-unit

testint:
cd test && make testint
test-int:
cd test && make test-int

testcov-func:
@go test -v -coverprofile="coverage.txt" . > /dev/null 2>&1
Expand All @@ -39,8 +39,8 @@ testcov-html:
@go test -v -coverprofile="coverage.txt" . > /dev/null 2>&1
@go tool cover -html coverage.txt

smoketest:
cd test && make smoketest
test-smoke:
cd test && make test-smoke

build: vet lint
go build ./...
Expand Down Expand Up @@ -77,7 +77,7 @@ run_fixtures:
LINODE_API_VERSION="v4beta" \
LINODE_URL="$(LINODE_URL)" \
GO111MODULE="on" \
go test --tags $(TEST_TAGS) -timeout=$(TEST_TIMEOUT) -v $(ARGS)
go test --tags $(TEST_TAGS) -timeout=$(TEST_TIMEOUT) -v $(TEST_ARGS)

sanitize:
@echo "* Sanitizing fixtures"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ When performing a `POST` or `PUT` request, multiple field related errors will be

## Tests

Run `make testunit` to run the unit tests.
Run `make test-unit` to run the unit tests.

Run `make testint` to run the integration tests. The integration tests use fixtures.
Run `make test-int` to run the integration tests. The integration tests use fixtures.

To update the test fixtures, run `make fixtures`. This will record the API responses into the `fixtures/` directory.
Be careful about committing any sensitive account details. An attempt has been made to sanitize IP addresses and
dates, but no automated sanitization will be performed against `fixtures/*Account*.yaml`, for example.

To prevent disrupting unaffected fixtures, target fixture generation like so: `make ARGS="-run TestListVolumes" fixtures`.
To prevent disrupting unaffected fixtures, target fixture generation like so: `make TEST_ARGS="-run TestListVolumes" fixtures`.

## Discussion / Help

Expand Down
3 changes: 1 addition & 2 deletions account_agreements.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ func (c *Client) GetAccountAgreements(ctx context.Context) (*AccountAgreements,

// AcknowledgeAccountAgreements acknowledges account agreements for the Account
func (c *Client) AcknowledgeAccountAgreements(ctx context.Context, opts AccountAgreementsUpdateOptions) error {
_, err := doPOSTRequest[AccountAgreements](ctx, c, "account/agreements", opts)
return err
return doPOSTRequestNoResponseBody(ctx, c, "account/agreements", opts)
}
Loading