Skip to content

Commit 4806808

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/otel-tracer
# Conflicts: # go.mod
2 parents ee4333f + 19d1551 commit 4806808

317 files changed

Lines changed: 12368 additions & 3740 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codacy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
---
21
exclude_paths:
32
- "**/*_test.go"
3+
4+
# Disable specific rules
5+
engines:
6+
markdownlint:
7+
enabled: true
8+
ignore_patterns:
9+
- markdownlint_MD013 # Line length rule

.github/workflows/codacy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
steps:
3737
# Checkout the repository to the GitHub Actions runner
3838
- name: Checkout code
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4040

4141
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
4242
- name: Run Codacy Analysis CLI
43-
uses: codacy/codacy-analysis-cli-action@97bf5df3c09e75f5bcd72695998f96ebd701846e
43+
uses: codacy/codacy-analysis-cli-action@97bf5df3c09e75f5bcd72695998f96ebd701846e # v4
4444
with:
4545
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
4646
# You can also omit the token and run the tools that support default configurations
@@ -56,6 +56,6 @@ jobs:
5656

5757
# Upload the SARIF file generated in the previous step
5858
- name: Upload SARIF results file
59-
uses: github/codeql-action/upload-sarif@v3
59+
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
6060
with:
6161
sarif_file: results.sarif

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
analyze:
2525
name: Analyze
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-latest
2727

2828
strategy:
2929
fail-fast: false
@@ -35,11 +35,11 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v3
42+
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v3
53+
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v3
67+
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1515
with:
1616
fetch-depth: 2
1717

1818
- name: Set up Go
19-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2020
with:
2121
go-version-file: ./go.mod
2222

.github/workflows/dependency-review.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# Source repository: https://github.com/actions/dependency-review-action
66
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
77
name: 'Dependency Review'
8-
on: [pull_request]
8+
on:
9+
pull_request:
910

1011
permissions:
1112
contents: read
@@ -15,6 +16,6 @@ jobs:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: 'Checkout Repository'
18-
uses: actions/checkout@v4
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1920
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@v4
21+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ jobs:
1919
strategy:
2020
max-parallel: 6
2121
matrix:
22-
go: [1.22, 1.23]
23-
os: [ubuntu-latest, macos-latest, windows-latest]
22+
go: [ 1.23, 1.24]
23+
os: [ ubuntu-latest, macos-latest, windows-latest ]
2424
runs-on: ${{ matrix.os }}
2525
steps:
2626
- name: Setup Go
27-
uses: actions/setup-go@v5
27+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2828
with:
2929
go-version: ${{ matrix.go }}
3030

3131
- name: Checkout code
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3333

3434
- name: golangci-lint
35-
uses: golangci/golangci-lint-action@v6
35+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
3636
with:
3737
version: latest
3838
args: --timeout=10m

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
strategy:
1414
max-parallel: 6
1515
matrix:
16-
go-version: [1.22, 1.23]
17-
platform: [ubuntu-latest, macos-latest, windows-latest]
16+
go-version: [ 1.23, 1.24 ]
17+
platform: [ ubuntu-latest, macos-latest, windows-latest ]
1818

1919
runs-on: ${{ matrix.platform }}
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2323

2424
- name: Install Go on the Container
25-
uses: actions/setup-go@v5
25+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2626
with:
2727
go-version: ${{ matrix.go-version }}
2828

.golangci.yaml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
1+
version: "2"
12
run:
23
concurrency: 4
3-
timeout: 20m
4-
tests: false
5-
# This gives us the ability to efficiently skip whole files by using "//go:build !codeanalysis" at the top of a file.
64
build-tags:
75
- codeanalysis
8-
6+
tests: false
97
linters:
108
enable:
119
- revive
12-
13-
linters-settings:
14-
revive:
15-
rules:
16-
- name: unused-parameter
17-
disabled: true # forces all unused to be "_" which leads to confusion
18-
10+
settings:
11+
revive:
12+
rules:
13+
- name: unused-parameter
14+
disabled: true
15+
exclusions:
16+
generated: lax
17+
presets:
18+
- comments
19+
- common-false-positives
20+
- legacy
21+
- std-error-handling
22+
paths:
23+
- third_party$
24+
- builtin$
25+
- examples$
1926
issues:
2027
max-issues-per-linter: 0
2128
max-same-issues: 0
22-
2329
severity:
24-
default-severity: critical
30+
default: critical
31+
formatters:
32+
exclusions:
33+
generated: lax
34+
paths:
35+
- third_party$
36+
- builtin$
37+
- examples$

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ go get github.com/ctreminiom/go-atlassian/v2
4848
## 📪 Packages
4949
Then import the package into your project as you normally would. You can import the following packages:
5050

51-
| Module | Path | URL's |
52-
|--------------------------------------|----------------------------------------------------------|----------------------------------------------------------------------------------------|
53-
| Jira v2 | `github.com/ctreminiom/go-atlassian/jira/v2` | [Getting Started](https://docs.go-atlassian.io/jira-software-cloud/introduction) |
54-
| Jira v3 | `github.com/ctreminiom/go-atlassian/jira/v3` | [Getting Started](https://docs.go-atlassian.io/jira-software-cloud/introduction) |
55-
| Jira Software Agile | `github.com/ctreminiom/go-atlassian/jira/agile` | [Getting Started](https://docs.go-atlassian.io/jira-agile/introduction) |
56-
| Jira Service Management | `github.com/ctreminiom/go-atlassian/jira/sm` | [Getting Started](https://docs.go-atlassian.io/jira-service-management/introduction) |
57-
| Jira Assets | `github.com/ctreminiom/go-atlassian/assets` | [Getting Started](https://docs.go-atlassian.io/jira-assets/overview) |
58-
| Confluence | `github.com/ctreminiom/go-atlassian/confluence` | [Getting Started](https://docs.go-atlassian.io/confluence-cloud/introduction) |
59-
| Confluence v2 | `github.com/ctreminiom/go-atlassian/confluence/v2` | [Getting Started](https://docs.go-atlassian.io/confluence-cloud/v2/introduction) |
60-
| Admin Cloud | `github.com/ctreminiom/go-atlassian/admin` | [Getting Started](https://docs.go-atlassian.io/atlassian-admin-cloud/overview) |
61-
| Bitbucket Cloud *(In Progress)*<br/> | `github.com/ctreminiom/go-atlassian/bitbucket` | [Getting Started](https://docs.go-atlassian.io/bitbucket-cloud/introduction) |
51+
| Module | Path | URL's |
52+
|-------------------------------------|-----------------------------------------------------------|----------------------------------------------------------------------------------------|
53+
| Jira v2 | `github.com/ctreminiom/go-atlassian/v2/jira/v2` | [Getting Started](https://docs.go-atlassian.io/jira-software-cloud/introduction) |
54+
| Jira v3 | `github.com/ctreminiom/go-atlassian/v2/jira/v3` | [Getting Started](https://docs.go-atlassian.io/jira-software-cloud/introduction) |
55+
| Jira Software Agile | `github.com/ctreminiom/go-atlassian/v2/jira/agile` | [Getting Started](https://docs.go-atlassian.io/jira-agile/introduction) |
56+
| Jira Service Management | `github.com/ctreminiom/go-atlassian/v2/jira/sm` | [Getting Started](https://docs.go-atlassian.io/jira-service-management/introduction) |
57+
| Jira Assets | `github.com/ctreminiom/go-atlassian/v2/assets` | [Getting Started](https://docs.go-atlassian.io/jira-assets/overview) |
58+
| Confluence | `github.com/ctreminiom/go-atlassian/v2/confluence` | [Getting Started](https://docs.go-atlassian.io/confluence-cloud/introduction) |
59+
| Confluence v2 | `github.com/ctreminiom/go-atlassian/v2/confluence/v2` | [Getting Started](https://docs.go-atlassian.io/confluence-cloud/v2/introduction) |
60+
| Admin Cloud | `github.com/ctreminiom/go-atlassian/v2/admin` | [Getting Started](https://docs.go-atlassian.io/atlassian-admin-cloud/overview) |
61+
| Bitbucket Cloud *(In Progress)* | `github.com/ctreminiom/go-atlassian/v2/bitbucket` | [Getting Started](https://docs.go-atlassian.io/bitbucket-cloud/introduction) |
6262

6363
-------------------------
6464
## 🔨 Usage
@@ -173,7 +173,7 @@ package main
173173
import (
174174
"context"
175175
"fmt"
176-
"github.com/ctreminiom/go-atlassian/jira/v3"
176+
"github.com/ctreminiom/go-atlassian/v2/jira/v3"
177177
"log"
178178
"net/http"
179179
"os"

admin/api_client_impl.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@ func (c *Client) processResponse(response *http.Response, structure interface{})
167167
switch response.StatusCode {
168168

169169
case http.StatusNotFound:
170-
return res, model.ErrNotFound
170+
return res, fmt.Errorf("client: %w", model.ErrNotFound)
171171

172172
case http.StatusUnauthorized:
173-
return res, model.ErrUnauthorized
173+
return res, fmt.Errorf("client: %w", model.ErrUnauthorized)
174174

175175
case http.StatusInternalServerError:
176-
return res, model.ErrInternal
176+
return res, fmt.Errorf("client: %w", model.ErrInternal)
177177

178178
case http.StatusBadRequest:
179-
return res, model.ErrBadRequest
179+
return res, fmt.Errorf("client: %w", model.ErrBadRequest)
180180

181181
default:
182-
return res, model.ErrInvalidStatusCode
182+
return res, fmt.Errorf("client: %w", model.ErrInvalidStatusCode)
183183
}
184184
}
185185

0 commit comments

Comments
 (0)