Skip to content

Commit

Permalink
Merge branch 'main' into indexed-artifacts-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Jun 2, 2023
2 parents 41f5e77 + e2153f3 commit bdee5e4
Show file tree
Hide file tree
Showing 316 changed files with 944 additions and 892 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
uses: dependabot/fetch-metadata@v1.5.1
with:
github-token: "${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}"
- name: Approve a PR
Expand Down
4 changes: 2 additions & 2 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ tasks:
# exist in tree so we must hard code the hash of the mozillareleases/taskgraph-decision docker image
command:
- - bash
- "-cx"
- "-cxe"
- |-
podman run --name taskcontainer --add-host=taskcluster:127.0.0.1 --net=host \
-e "REPOSITORIES={\"taskcluster\":\"taskcluster\"}" \
Expand All @@ -189,7 +189,7 @@ tasks:
--taskcluster-checkout=/builds/worker/checkouts/src \
--task-cwd=/builds/worker/checkouts/src \
-- \
bash -cx '
bash -cxe '
ln -s /builds/worker/artifacts artifacts
~/.local/bin/taskgraph decision \
--pushlog-id='\''0'\'' \
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
<!-- `yarn release` will insert the existing changelog snippets here: -->
<!-- NEXT RELEASE HERE -->

## v52.0.0

### GENERAL

[MAJOR] [#6227](https://github.com/taskcluster/taskcluster/issues/6227)
Generic Worker Simple engine is no longer _released_. It can still be built from source, but since it was never intended to be used as a production engine, and was only intended to support development (e.g. for running unit tests or running in a simple dev deployment) the simple engine binaries are no longer released.

### WORKER-DEPLOYERS

[patch] [#5006](https://github.com/taskcluster/taskcluster/issues/5006)
Generic Worker on macOS now dumps the output of the `last` command when it is not able to determine the logged in console user. This doesn't solve issue 5006 but it may provide additional troubleshooting information.

### USERS

[patch] [#6278](https://github.com/taskcluster/taskcluster/issues/6278)
Fix UI issue showing "Response code 404" for missing `public/actions.json` artifact.

[patch] [#5807](https://github.com/taskcluster/taskcluster/issues/5807)
Fixes escape sequence parsing in logs that are attached to github check runs.

## v51.1.0

### ADMINS
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARG DOCKER_FLOW_VERSION
RUN if [ -n "${DOCKER_FLOW_VERSION}" ]; then \
echo "${DOCKER_FLOW_VERSION}" > version.json; \
else \
echo \{\"version\": \"51.1.0\", \"commit\": \"local\", \"source\": \"https://github.com/taskcluster/taskcluster\", \"build\": \"NONE\"\} > version.json; \
echo \{\"version\": \"52.0.0\", \"commit\": \"local\", \"source\": \"https://github.com/taskcluster/taskcluster\", \"build\": \"NONE\"\} > version.json; \
fi

# Build the UI and discard everything else in that directory
Expand Down
3 changes: 3 additions & 0 deletions changelog/RqlmkNidTOO_wejZRuyvsA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
audience: general
level: silent
---
70 changes: 35 additions & 35 deletions clients/client-go/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Taskcluster Client for Go


[![GoDoc](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go?status.svg)](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go)
[![GoDoc](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go?status.svg)](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go)
[![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)

**A Taskcluster client library for Go.**
Expand All @@ -19,55 +19,55 @@ This library provides the following packages to interface with Taskcluster:
### HTTP APIs

<!--HTTP-API-start-->
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauthevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauthevents

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcgithubevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcgithubevents

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tchooksevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tchooksevents

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcnotifyevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcnotifyevents

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueueevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueueevents

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcworkermanagerevents
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcworkermanagerevents
<!--HTTP-API-end-->

### AMQP APIs

<!--AMQP-API-start-->
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcgithub
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcgithub

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tchooks
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tchooks

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcindex
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcindex

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcnotify
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcnotify

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcobject
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcobject

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcpurgecache
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcpurgecache

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcsecrets
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcsecrets

* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcworkermanager
* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcworkermanager
<!--AMQP-API-end-->

### Setup

Before invoking API methods, create a client object corresponding to the service you wish to communicate with.
See the [client subdirectories](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go#pkg-subdirectories) for the list of available packages, each beginning with `tc`.
See the [client subdirectories](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go#pkg-subdirectories) for the list of available packages, each beginning with `tc`.

The most common case is to use `NewFromEnv`, reading environment variables for credentials:

```go
import (
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue"

tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
)
queue := tcqueue.NewFromEnv()
```
Expand Down Expand Up @@ -97,15 +97,15 @@ For example, the `CreateTask` method is called like this:

```go
import (
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue"
"github.com/taskcluster/slugid-go"
)
task := tcqueue.TaskDefinitionRequest{..};
taskId: = slugid.Nice()
status := queue.CreateTask(taskId, &task)
```

Complete Godoc documentation of the available methods and types is [here](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go); see the "Directories" section to find the interfaces defined for specific services.
Complete Godoc documentation of the available methods and types is [here](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go); see the "Directories" section to find the interfaces defined for specific services.

### Specifying exponential backoff settings for HTTP request retries

Expand All @@ -120,7 +120,7 @@ something like this:
import (
"github.com/cenkalti/backoff/v3"
"github.com/taskcluster/httpbackoff/v3"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue"
)
queue := tcqueue.NewFromEnv()
settings := &backoff.ExponentialBackOff{
Expand All @@ -142,7 +142,7 @@ queue.HTTPBackoffClient = &httpbackoff.Client{

API methods which take credentials and have method GET can be invoked with a signed URL.
To generate such a URL, use the method with suffix `_SignedURL`, and pass as its final argument the duration for which the URL should be valid.
For example, to generate a URL for [Queue.GetArtifact](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue#Queue.GetArtifact_SignedURL):
For example, to generate a URL for [Queue.GetArtifact](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue#Queue.GetArtifact_SignedURL):

```go
url := queue.GetArtifact_SignedURL(taskId, runId, "my/secret/artifact.txt", 5 * time.Minutes)
Expand All @@ -156,9 +156,9 @@ party. See [the manual](https://docs.taskcluster.net/docs/manual/design/env-vars
more information.

Create named credentials with
[`Credentials.CreateNamedTemporaryCredentials`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go#Credentials.CreateNamedTemporaryCredentials),
[`Credentials.CreateNamedTemporaryCredentials`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go#Credentials.CreateNamedTemporaryCredentials),
or unnamed credentials with
[`Credentials.CreateTemporaryCredentials`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go#Credentials.CreateTemporaryCredentials).
[`Credentials.CreateTemporaryCredentials`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go#Credentials.CreateTemporaryCredentials).
Named credentials are preferred if you are not sure which type to use.

#### Example
Expand All @@ -173,8 +173,8 @@ import (
"strconv"
"time"

tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue"
)

const (
Expand Down Expand Up @@ -229,7 +229,7 @@ func main() {
### Handling Timestamps

Taskcluster uses RFC3339 timestamps, specifically with millisecond precision and a `Z` timestamp.
To support serializing and deserializing this format exactly, use the [`tcclient.Time`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go#Time) type instead of with the built-in `time.Time` type.
To support serializing and deserializing this format exactly, use the [`tcclient.Time`](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go#Time) type instead of with the built-in `time.Time` type.

All timestamp arithmetic should be performed with the built-in `time` package.

Expand Down Expand Up @@ -307,7 +307,7 @@ queue := tcqueue.New()
data, contentType, contentLength, err := queue.DownloadArtifactToBuf(taskId, runId, name)
```

See the [Go documentation](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue) for more detail.
See the [Go documentation](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue) for more detail.

## Compatibility

Expand All @@ -322,9 +322,9 @@ Any incompatibilities are noted in the [Changelog](https://github.com/taskcluste

To get you started quickly, some example programs are included that use both the HTTP APIs and the AMQP APIs:

* This [HTTP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth#example-package--Scopes) demonstrates the use of the [tcauth](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth) package to query the expiry and expanded scopes of a given clientId.
* This [HTTP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth#example-package--UpdateClient) demonstrates the use of the [tcauth](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth) package to update an existing clientId with a new description and expiry.
* The [AMQP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueueevents#example-package--TaskclusterSniffer) demonstrates the use of the [tcqueueevents](https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueueevents) package to listen in on Taskcluster tasks being defined and executed.
* This [HTTP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth#example-package--Scopes) demonstrates the use of the [tcauth](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth) package to query the expiry and expanded scopes of a given clientId.
* This [HTTP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth#example-package--UpdateClient) demonstrates the use of the [tcauth](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth) package to update an existing clientId with a new description and expiry.
* The [AMQP example program](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueueevents#example-package--TaskclusterSniffer) demonstrates the use of the [tcqueueevents](https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueueevents) package to listen in on Taskcluster tasks being defined and executed.

### Creating a Task

Expand All @@ -338,8 +338,8 @@ import (
"time"

"github.com/taskcluster/slugid-go/slugid"
tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcqueue"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcqueue"
)

// *********************************************************
Expand Down
4 changes: 2 additions & 2 deletions clients/client-go/codegenerator/model/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sort"
"strings"

"github.com/taskcluster/taskcluster/v51/tools/jsonschema2go/text"
"github.com/taskcluster/taskcluster/v52/tools/jsonschema2go/text"
)

//////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -122,7 +122,7 @@ import (
"errors"
"net/url"
"time"
tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
)
type ` + api.Name() + ` tcclient.Client
Expand Down
4 changes: 2 additions & 2 deletions clients/client-go/codegenerator/model/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package model
import (
"fmt"

"github.com/taskcluster/taskcluster/v51/tools/jsonschema2go/text"
"github.com/taskcluster/taskcluster/v52/tools/jsonschema2go/text"
)

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -157,7 +157,7 @@ func (exchange *Exchange) generateAPICode(exchangeName string) string {
import (
"reflect"
"strings"
tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
)
`
Expand Down
4 changes: 2 additions & 2 deletions clients/client-go/codegenerator/model/generatemodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"regexp"

docopt "github.com/docopt/docopt-go"
"github.com/taskcluster/taskcluster/v51/clients/client-go/codegenerator/model"
"github.com/taskcluster/taskcluster/v51/tools/jsonschema2go"
"github.com/taskcluster/taskcluster/v52/clients/client-go/codegenerator/model"
"github.com/taskcluster/taskcluster/v52/tools/jsonschema2go"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions clients/client-go/codegenerator/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"regexp"
"strings"

"github.com/taskcluster/taskcluster/v51/tools/jsonschema2go"
"github.com/taskcluster/taskcluster/v52/tools/jsonschema2go"
"golang.org/x/tools/imports"
)

Expand Down Expand Up @@ -184,7 +184,7 @@ func FormatSourceAndSave(sourceFile string, sourceCode []byte) {
// in GOPATH, so reset the TC version to the appropriate value. Note that
// the last argument here will be updated to the current version by `yarn
// release`, so this will always substitute the correct version.
formattedContent = regexp.MustCompile(`github\.com/taskcluster/taskcluster/v[0-9]+/`).ReplaceAll(formattedContent, []byte("github.com/taskcluster/taskcluster/v51/"))
formattedContent = regexp.MustCompile(`github\.com/taskcluster/taskcluster/v[0-9]+/`).ReplaceAll(formattedContent, []byte("github.com/taskcluster/taskcluster/v52/"))

// only perform general format, if that worked...
formattedContent, err = format.Source(formattedContent)
Expand Down Expand Up @@ -255,10 +255,10 @@ func (apiDefs APIDefinitions) GenerateCode(goOutputDir string) {

for i := range apiDefs {
if strings.Contains(apiDefs[i].PackageName, "events") {
amqpApiLinks += "\n" + "* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/" + apiDefs[i].PackageName + "\n"
amqpApiLinks += "\n" + "* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/" + apiDefs[i].PackageName + "\n"

} else {
httpApiLinks += "\n" + "* https://pkg.go.dev/github.com/taskcluster/taskcluster/v51/clients/client-go/" + apiDefs[i].PackageName + "\n"
httpApiLinks += "\n" + "* https://pkg.go.dev/github.com/taskcluster/taskcluster/v52/clients/client-go/" + apiDefs[i].PackageName + "\n"

}
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-go/creds.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/taskcluster/httpbackoff/v3"
"github.com/taskcluster/slugid-go/slugid"
"github.com/taskcluster/taskcluster/v51/tools/jsonschema2go/text"
"github.com/taskcluster/taskcluster/v52/tools/jsonschema2go/text"
)

// Credentials represents the set of credentials required to access protected
Expand Down
6 changes: 3 additions & 3 deletions clients/client-go/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth"
"github.com/taskcluster/taskcluster/v51/internal/testrooturl"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth"
"github.com/taskcluster/taskcluster/v52/internal/testrooturl"
)

func ExampleCredentials_CreateTemporaryCredentials() {
Expand Down
2 changes: 1 addition & 1 deletion clients/client-go/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/taskcluster/httpbackoff/v3"
"github.com/taskcluster/taskcluster/v51/internal/jsontest"
"github.com/taskcluster/taskcluster/v52/internal/jsontest"
)

func (c *Client) quickBackoff() {
Expand Down
8 changes: 4 additions & 4 deletions clients/client-go/integrationtest/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"testing"

"github.com/stretchr/testify/require"
tcclient "github.com/taskcluster/taskcluster/v51/clients/client-go"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcauth"
"github.com/taskcluster/taskcluster/v51/clients/client-go/tcsecrets"
"github.com/taskcluster/taskcluster/v51/internal/testrooturl"
tcclient "github.com/taskcluster/taskcluster/v52/clients/client-go"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcauth"
"github.com/taskcluster/taskcluster/v52/clients/client-go/tcsecrets"
"github.com/taskcluster/taskcluster/v52/internal/testrooturl"
)

// This function tests a simple unauthenticated request for the list of configured
Expand Down
4 changes: 2 additions & 2 deletions clients/client-go/tcauth/auth_examples_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bdee5e4

Please sign in to comment.