Skip to content

Commit 00721ed

Browse files
authored
Feat: Schema Validation Overhaul (#128)
## What * Overhaul schema validation by adding `internal/schemautils` and package * Overhaul general utils pattern by removing `utils.go` adding `internal/datautils.go` * Rename and move `client` package to `codefresh.cfclient` * Ensure plan-time CRON validation for `codefresh_pipeline` matches current API constraints, while maintaining backwards compatibility for the deprecated `codefresh_pipeline_cron_trigger` resource, which has different API constraints (6 fields instead of 5) ## Why * More DRY * Better package structure * CRON Validation fix ## Notes <!-- Add any notes here --> ## Checklist * [x] _I have read [CONTRIBUTING.md](https://github.com/codefresh-io/terraform-provider-codefresh/blob/master/CONTRIBUTING.md)._ * [x] _I have [allowed changes to my fork to be made](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)._ * [x] _I have added tests, assuming new tests are warranted_. * [x] _I understand that the `/test` comment will be ignored by the CI trigger [unless it is made by a repo admin or collaborator](https://codefresh.io/docs/docs/pipelines/triggers/git-triggers/#support-for-building-pull-requests-from-forks)._
1 parent 5ed1f24 commit 00721ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+949
-653
lines changed

client/account.go renamed to codefresh/cfclient/account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"errors"

client/api_key.go renamed to codefresh/cfclient/api_key.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package client
1+
package cfclient
22

33
import (
44
"errors"
55
"fmt"
6-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
76
"log"
7+
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
89
)
910

1011
type ApiKeySubject struct {

client/client.go renamed to codefresh/cfclient/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"bytes"

client/context.go renamed to codefresh/cfclient/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"fmt"

client/current_account.go renamed to codefresh/cfclient/current_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"encoding/json"

client/gitops_abac_rules.go renamed to codefresh/cfclient/gitops_abac_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"fmt"

client/gql_client.go renamed to codefresh/cfclient/gql_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"bytes"

client/hermes_trigger.go renamed to codefresh/cfclient/hermes_trigger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"fmt"

client/hermes_trigger_event.go renamed to codefresh/cfclient/hermes_trigger_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"fmt"

client/idp.go renamed to codefresh/cfclient/idp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package cfclient
22

33
import (
44
"errors"

0 commit comments

Comments
 (0)