diff --git a/.github/workflows/publish-branch.yaml b/.github/workflows/publish-branch.yaml new file mode 100644 index 0000000..c3969fc --- /dev/null +++ b/.github/workflows/publish-branch.yaml @@ -0,0 +1,66 @@ +# Copyright The Linux Foundation and each contributor to LFX. +# SPDX-License-Identifier: MIT +--- +name: Publish Container Branch + +"on": + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + publish: + name: Publish Container + if: ${{ github.event.pull_request.head.repo.fork == false }} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 + with: + go-version-file: go.mod + - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 + with: + version: v0.18.0 + - name: Prepare container tag + id: container_tag + env: + HEAD_REF: "${{ github.head_ref }}" + run: | + container_tag=$(echo "$HEAD_REF" | sed 's/[^_0-9a-zA-Z]/-/g' | cut -c -127) + echo tag="$container_tag" >> "$GITHUB_OUTPUT" + - name: Build lfx-v1-sync-helper for PR + env: + VERSION: ${{ steps.container_tag.outputs.tag }} + GIT_COMMIT: ${{ github.sha }} + run: | + BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S') + export BUILD_TIME + GIT_COMMIT=${GIT_COMMIT:0:7} + export GIT_COMMIT + ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/lfx-v1-sync-helper \ + -B \ + --platform linux/amd64,linux/arm64 \ + -t ${{ github.sha }} \ + -t ${{ steps.container_tag.outputs.tag }} \ + --sbom spdx + - name: Build dynamodb-stream-consumer for PR + env: + VERSION: ${{ steps.container_tag.outputs.tag }} + GIT_COMMIT: ${{ github.sha }} + run: | + BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S') + export BUILD_TIME + GIT_COMMIT=${GIT_COMMIT:0:7} + export GIT_COMMIT + ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/dynamodb-stream-consumer \ + -B \ + --platform linux/amd64,linux/arm64 \ + -t ${{ github.sha }} \ + -t ${{ steps.container_tag.outputs.tag }} \ + --sbom spdx diff --git a/cmd/lfx-v1-sync-helper/handlers_committees.go b/cmd/lfx-v1-sync-helper/handlers_committees.go index 63bb361..7824dd7 100644 --- a/cmd/lfx-v1-sync-helper/handlers_committees.go +++ b/cmd/lfx-v1-sync-helper/handlers_committees.go @@ -412,7 +412,7 @@ func mapV1DataToCommitteeCreatePayload(ctx context.Context, v1Data map[string]an // Map governance fields (requires lfx-v2-committee-service >= v0.3.0 with PR #61 merged). if joinMode, ok := v1Data["join_mode"].(string); ok && joinMode != "" { - payload.JoinMode = &joinMode + payload.JoinMode = joinMode logger.With("join_mode", joinMode).DebugContext(ctx, "mapped committee join mode field") } if mailingListEmail, ok := v1Data["mailing_list_email"].(string); ok && mailingListEmail != "" { @@ -489,10 +489,7 @@ func mapV1DataToCommitteeUpdateBasePayload(ctx context.Context, committeeUID str // UpdateCommitteeBasePayload does not support BusinessEmailRequired field. // Map governance fields (requires lfx-v2-committee-service >= v0.3.0 with PR #61 merged). - if joinMode, ok := v1Data["join_mode"].(string); ok && joinMode != "" { - payload.JoinMode = &joinMode - logger.With("join_mode", joinMode).DebugContext(ctx, "mapped committee join mode field for update") - } + // Note: JoinMode is not available on UpdateCommitteeBasePayload. if mailingListEmail, ok := v1Data["mailing_list_email"].(string); ok && mailingListEmail != "" { payload.MailingList = &mailingListEmail logger.With("mailing_list_email", mailingListEmail).DebugContext(ctx, "mapped committee mailing list email field for update") diff --git a/cmd/lfx-v1-sync-helper/lfx_v2_client.go b/cmd/lfx-v1-sync-helper/lfx_v2_client.go index 091a6fd..8b43aa9 100644 --- a/cmd/lfx-v1-sync-helper/lfx_v2_client.go +++ b/cmd/lfx-v1-sync-helper/lfx_v2_client.go @@ -215,6 +215,17 @@ func initGoaClients(cfg *Config) error { committeeHTTPClient.GetCommitteeMember(), committeeHTTPClient.UpdateCommitteeMember(), committeeHTTPClient.DeleteCommitteeMember(), + committeeHTTPClient.GetInvite(), + committeeHTTPClient.CreateInvite(), + committeeHTTPClient.RevokeInvite(), + committeeHTTPClient.AcceptInvite(), + committeeHTTPClient.DeclineInvite(), + committeeHTTPClient.GetApplication(), + committeeHTTPClient.SubmitApplication(), + committeeHTTPClient.ApproveApplication(), + committeeHTTPClient.RejectApplication(), + committeeHTTPClient.JoinCommittee(), + committeeHTTPClient.LeaveCommittee(), ) } diff --git a/go.mod b/go.mod index be1d633..0c30ca4 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 github.com/golang-jwt/jwt/v5 v5.3.1 github.com/google/uuid v1.6.0 - github.com/linuxfoundation/lfx-v2-committee-service v0.2.19 - github.com/linuxfoundation/lfx-v2-indexer-service v0.4.14 + github.com/linuxfoundation/lfx-v2-committee-service v0.2.22 + github.com/linuxfoundation/lfx-v2-indexer-service v0.4.16 github.com/linuxfoundation/lfx-v2-project-service v0.5.6 github.com/nats-io/nats.go v1.48.0 github.com/patrickmn/go-cache v2.1.0+incompatible @@ -39,7 +39,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.30.10 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.14 // indirect github.com/aws/smithy-go v1.24.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/go-chi/chi/v5 v5.2.5 // indirect github.com/goccy/go-json v0.10.5 // indirect @@ -53,7 +52,6 @@ require ( github.com/lestrrat-go/option v1.0.1 // indirect github.com/nats-io/nkeys v0.4.15 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/segmentio/asm v1.2.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.devnw.com/structs v1.0.0 // indirect diff --git a/go.sum b/go.sum index 61f7f42..9740c4a 100644 --- a/go.sum +++ b/go.sum @@ -74,10 +74,14 @@ github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVf github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/linuxfoundation/lfx-v2-committee-service v0.2.19 h1:xMeqXvf7NLk9JlfAEpNHBpwFtvtNTnwR/bOjxY/5Fa4= -github.com/linuxfoundation/lfx-v2-committee-service v0.2.19/go.mod h1:vhFiTH/CEDcs2kHmDofKzJclW1ZtBlfaRH0brL6lfek= +github.com/linuxfoundation/lfx-v2-committee-service v0.2.21 h1:UVijQzkz/7VGNC8lVPqgoOG3jqHylbBrl8n7Fx8JTE8= +github.com/linuxfoundation/lfx-v2-committee-service v0.2.21/go.mod h1:zhJDE23mzaiUv1ZACoelN8w9JoUb/Kt9TPuHxU89T9Q= +github.com/linuxfoundation/lfx-v2-committee-service v0.2.22 h1:/zrQGAT4zrRd02BRkpJUWp4Rrx5+ihIptWMiVA1AQ4Y= +github.com/linuxfoundation/lfx-v2-committee-service v0.2.22/go.mod h1:8Jry9qGxz9bMDKrukMK60w4CkElPJC61wm0omZU63Sk= github.com/linuxfoundation/lfx-v2-indexer-service v0.4.14 h1:GQpAYAjEUNJgg/r4gxGG/teWAAp0eN5+pt/eiM3uaXo= github.com/linuxfoundation/lfx-v2-indexer-service v0.4.14/go.mod h1:j013GdKST/hMWFhciRuzJd0sy764sNtlmO3gqmsnaCA= +github.com/linuxfoundation/lfx-v2-indexer-service v0.4.16 h1:pOcjVN+KQo2h80je1glL0p69aekwpxmzcTE0VHDwQ/8= +github.com/linuxfoundation/lfx-v2-indexer-service v0.4.16/go.mod h1:hLf2Hl39PsUg2qtl5os0noXxCXWHrkO26EPT+G0RhmA= github.com/linuxfoundation/lfx-v2-project-service v0.5.6 h1:TvSfGXuI1tZ72eVAc4MbAcn8+evtUhVyvas7W90lPNk= github.com/linuxfoundation/lfx-v2-project-service v0.5.6/go.mod h1:+CMLc9XBQ4uUUAAa9ioYklcdamVwGkU+DrR+tz/PqZ8= github.com/nats-io/nats.go v1.48.0 h1:pSFyXApG+yWU/TgbKCjmm5K4wrHu86231/w84qRVR+U=