Merged in feature/ecr (pull request #161)

Feature/ecr

* nosave

* repo

* awscli

* unzip

* ignore

* moreram

* 14k

* ref

* deployment

* 12k

* uselocal

* go

* dockercomd

* reorder

* iamgename

* installs

* tart

* cli

* clideps

* y

* dockerce

* nodock

* multi

* rmecr

* dev
This commit is contained in:
Michael McGuinness
2025-06-03 13:52:10 +00:00
parent ae4b456399
commit 7ce7c9df4d
73 changed files with 295 additions and 326 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func (s *Service) normalizeCreate(params *CreateParams) error {
return nil
}
// Make sure the char ~ never makes way in as a valid client id character
// NOTE: Make sure the char ~ never makes way in as a valid client id character
// Reference bucket key filename
const CLIENT_ID_REGEX = `[a-zA-Z0-9\_#-]+`
+1 -2
View File
@@ -1,7 +1,6 @@
package client
import (
"context"
"testing"
"queryorchestration/internal/database/repository"
@@ -13,7 +12,7 @@ import (
)
func TestCreate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+1 -2
View File
@@ -1,7 +1,6 @@
package client
import (
"context"
"errors"
"testing"
@@ -14,7 +13,7 @@ import (
)
func TestGet(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+17 -17
View File
@@ -14,28 +14,28 @@ type Client struct {
CanSync bool
}
func (c *Client) NormalizeCanSyncUpdate(n **bool) {
if n == nil || *n == nil {
func (c *Client) NormalizeCanSyncUpdate(canSync **bool) {
if canSync == nil || *canSync == nil {
return
}
if c.CanSync == **n {
*n = nil
if c.CanSync == **canSync {
*canSync = nil
}
}
func (c *Client) NormalizeNameUpdate(n **string) error {
if n == nil || *n == nil {
func (c *Client) NormalizeNameUpdate(name **string) error {
if name == nil || *name == nil {
return nil
}
err := normalizeName(*n)
err := normalizeName(*name)
if err != nil {
return err
}
if c.Name == **n {
*n = nil
if c.Name == **name {
*name = nil
}
return nil
@@ -46,18 +46,18 @@ func normalizeName(name *string) error {
return nil
}
uname := strings.TrimSpace(*name)
spacere := regexp.MustCompile(`\s+`)
uname = spacere.ReplaceAllString(uname, " ")
normalizedName := strings.TrimSpace(*name)
spaceRegex := regexp.MustCompile(`\s+`)
normalizedName = spaceRegex.ReplaceAllString(normalizedName, " ")
reg := `^[a-zA-Z0-9\_\- \(\)\.\,]+$`
validNameRegex := `^[a-zA-Z0-9\_\- \(\)\.\,]+$`
alphanumeric := regexp.MustCompile(reg)
if !alphanumeric.MatchString(uname) {
return fmt.Errorf(`"%s" must have regex: %s`, uname, reg)
alphanumeric := regexp.MustCompile(validNameRegex)
if !alphanumeric.MatchString(normalizedName) {
return fmt.Errorf(`"%s" must have regex: %s`, normalizedName, validNameRegex)
}
*name = uname
*name = normalizedName
return nil
}
+27 -27
View File
@@ -34,51 +34,51 @@ func TestNormalizeName(t *testing.T) {
}
func TestNormalizeCanSyncUpdate(t *testing.T) {
c := Client{
testClient := Client{
ID: "EXAMPLE",
CanSync: true,
}
c.NormalizeCanSyncUpdate(nil)
var val *bool
c.NormalizeCanSyncUpdate(&val)
assert.Nil(t, val)
testClient.NormalizeCanSyncUpdate(nil)
var updateCanSync *bool
testClient.NormalizeCanSyncUpdate(&updateCanSync)
assert.Nil(t, updateCanSync)
v := true
val = &v
c.NormalizeCanSyncUpdate(&val)
assert.Nil(t, val)
canSync := true
updateCanSync = &canSync
testClient.NormalizeCanSyncUpdate(&updateCanSync)
assert.Nil(t, updateCanSync)
v = false
val = &v
c.NormalizeCanSyncUpdate(&val)
assert.NotNil(t, *val)
canSync = false
updateCanSync = &canSync
testClient.NormalizeCanSyncUpdate(&updateCanSync)
assert.NotNil(t, *updateCanSync)
}
func TestNormalizeNameUpdate(t *testing.T) {
c := Client{
testClient := Client{
ID: "EXAMPLE",
Name: "example_name",
}
err := c.NormalizeNameUpdate(nil)
err := testClient.NormalizeNameUpdate(nil)
require.NoError(t, err)
v := "update_name"
val := &v
err = c.NormalizeNameUpdate(&val)
name := "update_name"
updateName := &name
err = testClient.NormalizeNameUpdate(&updateName)
require.NoError(t, err)
assert.NotNil(t, val)
assert.Equal(t, "update_name", *val)
assert.NotNil(t, updateName)
assert.Equal(t, "update_name", *updateName)
v = c.Name
val = &v
err = c.NormalizeNameUpdate(&val)
name = testClient.Name
updateName = &name
err = testClient.NormalizeNameUpdate(&updateName)
require.NoError(t, err)
assert.Nil(t, val)
assert.Nil(t, updateName)
v = "###"
val = &v
err = c.NormalizeNameUpdate(&val)
name = "###"
updateName = &name
err = testClient.NormalizeNameUpdate(&updateName)
assert.Error(t, err)
}
+1 -2
View File
@@ -1,7 +1,6 @@
package client_test
import (
"context"
"errors"
"testing"
@@ -15,7 +14,7 @@ import (
)
func TestGetStatus(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+2 -3
View File
@@ -1,7 +1,6 @@
package clientsync
import (
"context"
"fmt"
"testing"
@@ -25,7 +24,7 @@ type ClientSyncConfig struct {
func TestTrigger(t *testing.T) {
t.Run("two batches", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -86,7 +85,7 @@ func TestTrigger(t *testing.T) {
require.NoError(t, err)
})
t.Run("empty batch", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+3 -4
View File
@@ -1,7 +1,6 @@
package clientupdate
import (
"context"
"fmt"
"testing"
@@ -25,7 +24,7 @@ type Config struct {
}
func TestUpdate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -119,7 +118,7 @@ func TestNormalizeUpdateParams(t *testing.T) {
}
func TestSubmitUpdate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -167,7 +166,7 @@ func TestSubmitUpdate(t *testing.T) {
}
func TestInformUpdate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &Config{}
mockSQS := queuemock.NewMockSQSClient(t)