~emersion/hut-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] builds secrets: Indicate if a secret was shared

Details
Message ID
<20230830090248.117208-1-admin@xenrox.net>
DKIM signature
missing
Download raw message
Patch: +9 -1
---
 builds.go                          | 5 +++++
 srht/buildssrht/gql.go             | 2 +-
 srht/buildssrht/operations.graphql | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/builds.go b/builds.go
index 687e211..8894c2e 100644
--- a/builds.go
@@ -659,6 +659,11 @@ func printSecret(w io.Writer, secret *buildssrht.Secret) {
	var s string
	created := termfmt.Dim.String(humanize.Time(secret.Created.Time))
	s += fmt.Sprintf("%s\t%s\n", termfmt.DarkYellow.Sprint(secret.Uuid), created)

	if secret.FromUser != nil {
		s += termfmt.Dim.Sprintf("Shared by %s\n", secret.FromUser.CanonicalName)
	}

	if secret.Name != nil && *secret.Name != "" {
		s += fmt.Sprintf("%s\n", *secret.Name)
	}
diff --git a/srht/buildssrht/gql.go b/srht/buildssrht/gql.go
index d093e08..b760262 100644
--- a/srht/buildssrht/gql.go
+++ b/srht/buildssrht/gql.go
@@ -645,7 +645,7 @@ func Show(client *gqlclient.Client, ctx context.Context, id int32) (job *Job, er
}

func Secrets(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (secrets *SecretCursor, err error) {
	op := gqlclient.NewOperation("query secrets ($cursor: Cursor) {\n\tsecrets(cursor: $cursor) {\n\t\tresults {\n\t\t\tcreated\n\t\t\tuuid\n\t\t\tname\n\t\t\t__typename\n\t\t\t... on SecretFile {\n\t\t\t\tpath\n\t\t\t\tmode\n\t\t\t}\n\t\t}\n\t\tcursor\n\t}\n}\n")
	op := gqlclient.NewOperation("query secrets ($cursor: Cursor) {\n\tsecrets(cursor: $cursor) {\n\t\tresults {\n\t\t\tcreated\n\t\t\tuuid\n\t\t\tname\n\t\t\tfromUser {\n\t\t\t\tcanonicalName\n\t\t\t}\n\t\t\t__typename\n\t\t\t... on SecretFile {\n\t\t\t\tpath\n\t\t\t\tmode\n\t\t\t}\n\t\t}\n\t\tcursor\n\t}\n}\n")
	op.Var("cursor", cursor)
	var respData struct {
		Secrets *SecretCursor
diff --git a/srht/buildssrht/operations.graphql b/srht/buildssrht/operations.graphql
index 10f96b4..cccae73 100644
--- a/srht/buildssrht/operations.graphql
+++ b/srht/buildssrht/operations.graphql
@@ -142,6 +142,9 @@ query secrets($cursor: Cursor) {
            created
            uuid
            name
            fromUser {
                canonicalName
            }
            __typename
            ... on SecretFile {
                path

base-commit: 79f13c07bf884d8091acd65d7e9cff9839ef5a54
--
2.42.0
Details
Message ID
<UEh3FKGs0bW13zB3Ek7dnB-LtclzDQgEeS3TAIZ-lC573BFQoxwnKdW51puYYPxXGm5JdqW_CcD9Z_jDFp9om1z68lv4DakxZ5e2B6fjHp8=@emersion.fr>
In-Reply-To
<20230830090248.117208-1-admin@xenrox.net> (view parent)
DKIM signature
missing
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)