Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixing existing consumer test #39

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4155f60
wip/fixing the pact test
Saup21 Jun 4, 2024
4cb47ac
chore: updated pact tests
Saup21 Jun 4, 2024
9ce4fda
chore: updated pact fixed more cases
Saup21 Jun 4, 2024
4d783c2
chore: fixed create role case
Saup21 Jun 5, 2024
7ada376
chore: fixing create environment case
Saup21 Jun 7, 2024
c49337d
chore: fixed create and update secrets test
Saup21 Jun 10, 2024
e2e8ca7
chore: token regen test and webhooks test fixed
Saup21 Jun 11, 2024
80d91eb
chore: get admin team test fixed
Saup21 Jun 11, 2024
1b000d3
chore: fixed post webhooks response status
Saup21 Jun 12, 2024
63a4f20
chore: fixed update teams test
Saup21 Jun 13, 2024
22a2471
chore: fixed update team assignment test
Saup21 Jun 13, 2024
f022dee
chore: fixed create webhook test
Saup21 Jun 18, 2024
9e1b8e2
chore: added state to auth settings test and fixed the build
Saup21 Jun 20, 2024
d4a4f36
chore: fixed update user role test
Saup21 Jun 21, 2024
187529e
chore: updated pact-go and fixed location header in pact test
Saup21 Jun 21, 2024
eae6902
chore: added a script to fix the incorrect headers key matching rule …
Saup21 Jun 24, 2024
973a614
fix: fixed a typo
Saup21 Jun 24, 2024
146c6ae
test: testing if my script broke the build
Saup21 Jun 24, 2024
5c74dc0
chore: trying to update the makefile to run the transform script
Saup21 Jun 24, 2024
e1b08c6
chore: force re-install latest ffi
Saup21 Jun 24, 2024
9175dc3
Revert "chore: force re-install latest ffi"
Saup21 Jun 24, 2024
d53d7a0
chore: fixed invite user test
Saup21 Jun 24, 2024
e183246
chore: fixed update environment pact
Saup21 Jun 24, 2024
a728e20
chore: updated the pact-go version in makefile
Saup21 Jun 25, 2024
8c734a1
chore: debugging the pact file transform script
Saup21 Jun 25, 2024
42559c4
chore: updated the trasnform script
Saup21 Jun 25, 2024
b757bee
chore: fixed the trasnform script for linux env
Saup21 Jun 25, 2024
c26f162
chore: fixed some false commits
Saup21 Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ deps:
go install github.com/modocache/gover@latest; \
go install github.com/mitchellh/gox@latest; \
cd -
go install github.com/pact-foundation/pact-go/[email protected].2;
go install github.com/pact-foundation/pact-go/[email protected].5;

goveralls:
goveralls -service="travis-ci" -coverprofile=coverage.txt -repotoken $(COVERALLS_TOKEN)
Expand Down Expand Up @@ -87,6 +87,8 @@ pact: pact-go
go test -tags=consumer -count=1 -v github.com/pactflow/terraform/client/...

publish:
@echo "--- 🤝 Transforming Broken Keys in Pact File"
"$(PWD)/scripts/transform-broken-keys.sh"
@echo "--- 🤝 Publishing Pact"
"${PACT_CLI}" publish ${PWD}/client/pacts --consumer-app-version ${GITHUB_SHA} --tag ${GITHUB_BRANCH}

Expand Down
4 changes: 2 additions & 2 deletions broker/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type AuthenticationProviders struct {

// GoogleAuthenticationSettings configures the allowed email domains to authenticate to Pactflow
type GoogleAuthenticationSettings struct {
EmailDomains []string `json:"EmailDomains"`
EmailDomains []string `json:"emailDomains"`
}

// GithubAuthenticationSettings configures the allowed organisations that may authenticate to Pactflow
// NOTE: this does not perform any Github OAuth process, which must be confirmed via the UI after enabling
type GithubAuthenticationSettings struct {
Organizations []string `json:"GithubOrganizations"`
Organizations []string `json:"githubOrganizations"`
}
7 changes: 6 additions & 1 deletion broker/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ type EnvironmentCreateOrUpdateResponse struct {
}

type EnvironmentEmbeddedItems struct {
Teams []Team `json:"teams,omitempty"`
Teams []EnvironmentEmbeddedTeams `json:"teams,omitempty"`
}

type EnvironmentEmbeddedTeams struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
}

// POST environments
Expand Down
1 change: 0 additions & 1 deletion broker/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ type Role struct {
}

type Permission struct {
Name string `json:"name,omitempty"`
Scope string `json:"scope,omitempty"`
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion broker/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Secret struct {
TeamUUID string `json:"teamUuid,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Value string `json:"value"`
Value string `json:"value,omitempty"`
}

// curl 'https://dius.pact.dius.com.au/secrets' '{"name":"foo","description":"bar","value":"baz"}' --compressed
Expand Down
30 changes: 26 additions & 4 deletions broker/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,31 @@ type Team struct {

type TeamEmbeddedItems struct {
Pacticipants []Pacticipant `json:"pacticipants,omitempty"`
Members []User `json:"members,omitempty"`
Administrators []User `json:"administrators,omitempty"`
Environments []Environment `json:"environments,omitempty"`
Members []TeamUser `json:"members,omitempty"`
Administrators []TeamUser `json:"administrators,omitempty"`
Environments []TeamEnvironment `json:"environments,omitempty"`
}

type TeamUser struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
Active bool `json:"active"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
LastLogin string `json:"lastLogin,omitempty"`
IdentityProviderID string `json:"identityProviderId,omitempty"`
Type UserType `json:"type,omitempty"`
TypeDescription string `json:"typeDescription,omitempty"`
}

type TeamEnvironment struct {
Name string `json:"name,omitempty"`
Production bool `json:"production"`
DisplayName string `json:"displayName,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
UUID string `json:"uuid,omitempty"`
}

type TeamsResponse struct {
Expand Down Expand Up @@ -41,7 +63,7 @@ type TeamsAssignmentResponse struct {
}

type EmbeddedUsers = struct {
Users []User `json:"users,omitempty"`
Users []TeamUser `json:"users,omitempty"`
}

// Create POST /admin/teams
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const (
userAgent = "go-pact/" + version.LIBRARY_VERSION
userAgent = "terraform-pact/" + version.LIBRARY_VERSION
defaultBaseURL = "http://localhost"
webhookReadUpdateDeleteTemplate = "/webhooks/%s"
webhookCreateTemplate = "/webhooks"
Expand Down
Loading
Loading