Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ blank_issues_enabled: false
contact_links:
- name: MongoDB Atlas App Services Support
url: https://support.mongodb.com/
about: Support is provided under MongoDB support plans. Please submit support questions within the Realm UI.
about: Support is provided under MongoDB support plans. Please submit support questions within the App Services UI.
- name: MongoDB MongoDB Atlas App Services
url: https://www.mongodb.com/docs/atlas/app-services/
about: Learn more about MongoDB MongoDB Atlas App Services
24 changes: 15 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<!--
Thanks for contributing to MongoDB Ops Manager Go Client!

Before you submit your pull request, please be sure that you've reviewed our contributing guidelines: https://github.com/mongodb/go-client-mongodb-ops-manager/blob/master/CONTRIBUTING.md
Thanks for contributing to Atlas App Services Go client!

Please fill out the information below to help speed the review along, and hopefully
the merge of your pull request!
-->

## Proposed changes

<!--
<!-- s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Describe the big picture of your changes here and communicate why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.
-->

_Jira ticket:_

## Type of change:

- [ ] Bug fix (non-breaking change which fixes an issue).
- [ ] New feature (non-breaking change which adds functionality).
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
- [ ] This change requires a documentation update
- [ ] Documentation fix/enhancement

<!--
What MongoDB Ops Manager Go Client issue does this PR address? (for example, #1234), remove this section if none
What Atlas App Services Go client issue does this PR address? (for example, #1234), remove this section if none
-->

Closes #[issue number]
Expand All @@ -29,10 +35,10 @@ Put an `x` in the boxes that apply. You can also fill these out after creating t
don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
-->

- [] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
- [] I have added tests that prove my fix is effective or that my feature works
- [] I have added any necessary documentation (if appropriate)
- [] I have run `make fmt` and formatted my code
- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added any necessary documentation (if appropriate)
- [ ] I have run `make fmt` and formatted my code

## Further comments

Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: 'New Release'
run-name: 'Release ${{ inputs.version_number }} (use existing tag: ${{ inputs.use_existing_tag}})'

on:
workflow_dispatch:
inputs:
version_number:
description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)'
required: true
use_existing_tag:
description: 'Set value to `true` to use an existing tag for the release process, default is `false`'
default: 'false'

jobs:

release-config:
runs-on: ubuntu-latest
permissions: {}
outputs:
creates_new_tag: ${{ steps.evaluate_inputs.outputs.creates_new_tag }}
steps:
- id: evaluate_inputs
run: |
{
echo "creates_new_tag=$(if [ '${{ inputs.use_existing_tag }}' = 'true' ]; then echo 'false'; else echo 'true'; fi)"
} >> "$GITHUB_OUTPUT"

validate-inputs:
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Validation of version format
run: |
echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$'
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ inputs.use_existing_tag == 'true' && inputs.version_number || 'main' }}

create-tag:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [ release-config, validate-inputs ]
if: >-
!cancelled()
&& !contains(needs.*.result, 'failure')
&& needs.release-config.outputs.creates_new_tag == 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: 'main'
- name: Get the latest commit SHA
id: get-sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Create release tag
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72
with:
tag: ${{ inputs.version_number }}
commit_sha: ${{ steps.get-sha.outputs.sha }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PASSPHRASE }}

release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [ validate-inputs, create-tag ]
if: >-
!cancelled()
&& !contains(needs.*.result, 'failure')
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ inputs.version_number }}
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version-file: 'go.mod'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3
with:
version: '~> v2'
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

builds:
- skip: true
changelog:
sort: asc
use: github
filters:
exclude:
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: "New Features"
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 10
- title: Other
order: 999

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256

signs:
- artifacts: checksum
args:
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Go HTTP client for the [MongoDB Atlas App Services Admin API](https://www.mong
## Usage

```go
import "go.mongodb.org/atlas-appservices/appservices"
import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices"
```

Construct a new App Services client, then use the various services on the client to
Expand Down
6 changes: 3 additions & 3 deletions appservices/appservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package appservices // import "go.mongodb.org/realm/realm"
package appservices // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices"

import (
"bytes"
Expand All @@ -27,9 +27,9 @@ import (
"reflect"
"strings"

"github.com/google/go-querystring/query"

"go.mongodb.org/atlas/mongodbatlas"

"github.com/google/go-querystring/query"
)

const (
Expand Down
3 changes: 3 additions & 0 deletions appservices/event_triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,7 @@ type EventTriggerConfig struct {
ScheduleType string `json:"schedule_type,omitempty"`
Unordered *bool `json:"unordered,omitempty"`
ClusterName string `json:"clusterName,omitempty"`
TolerateResumeErrors *bool `json:"tolerate_resume_errors,omitempty"`
SkipCatchupEvents *bool `json:"skip_catchup_events,omitempty"`
MaximumThroughput *bool `json:"maximum_throughput,omitempty"`
}
14 changes: 13 additions & 1 deletion appservices/event_triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func TestEventTriggers_CreateDatabase(t *testing.T) {
Project: `{"updateDescription.updatedFields.FieldA": 1, "operationType": 1}`,
FullDocument: pointy.Bool(false),
FullDocumentBeforeChange: pointy.Bool(false),
TolerateResumeErrors: pointy.Bool(true),
SkipCatchupEvents: pointy.Bool(true),
MaximumThroughput: pointy.Bool(true),
Unordered: pointy.Bool(false),
},
EventProcessors: map[string]interface{}{
Expand Down Expand Up @@ -159,6 +162,9 @@ func TestEventTriggers_CreateDatabase(t *testing.T) {
"full_document": false,
"full_document_before_change": false,
"unordered": false,
"tolerate_resume_errors": true,
"skip_catchup_events": true,
"maximum_throughput": true,
},
"event_processors": map[string]interface{}{
"AWS_EVENTBRIDGE": map[string]interface{}{
Expand Down Expand Up @@ -204,7 +210,10 @@ func TestEventTriggers_CreateDatabase(t *testing.T) {
"project": {"updateDescription.updatedFields.FieldA": 1, "operationType": 1},
"full_document": false,
"full_document_before_change": false,
"unordered": false
"unordered": false,
"tolerate_resume_errors": true,
"skip_catchup_events": true,
"maximum_throughput": true
},
"event_processors": {
"AWS_EVENTBRIDGE": {
Expand Down Expand Up @@ -248,6 +257,9 @@ func TestEventTriggers_CreateDatabase(t *testing.T) {
FullDocument: pointy.Bool(false),
FullDocumentBeforeChange: pointy.Bool(false),
Unordered: pointy.Bool(false),
TolerateResumeErrors: pointy.Bool(true),
SkipCatchupEvents: pointy.Bool(true),
MaximumThroughput: pointy.Bool(true),
ClusterName: "cluster name",
},
EventProcessors: map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package auth // import "go.mongodb.org/realm/auth"
package auth // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/auth"

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.mongodb.org/atlas-appservices
module github.com/mongodb-labs/go-client-mongodb-atlas-app-services

go 1.23

Expand Down
Loading