Skip to content

Commit

Permalink
Merge pull request #186 from overmindtech/charms
Browse files Browse the repository at this point in the history
Charms
  • Loading branch information
DavidS-ovm authored Mar 4, 2024
2 parents be704cb + acbeefc commit fa05ea3
Show file tree
Hide file tree
Showing 20 changed files with 1,168 additions and 276 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Flags:
Use "overmind [command] --help" for more information about a command.
```

Set the environment variable `ACCESSIBLE` to `'true'` to enable screenreader mode.

## Examples

Upload a terraform plan to overmind for Blast Radius Analysis:
Expand Down
2 changes: 1 addition & 1 deletion cmd/bookmarks_create_bookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func CreateBookmark(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:write"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:write"})
if err != nil {
log.WithContext(ctx).WithError(err).WithFields(lf).Error("failed to authenticate")
return 1
Expand Down
2 changes: 1 addition & 1 deletion cmd/bookmarks_get_affected_bookmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func GetAffectedBookmarks(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:read"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:read"})
if err != nil {
log.WithContext(ctx).WithError(err).WithFields(lf).Error("failed to authenticate")
return 1
Expand Down
2 changes: 1 addition & 1 deletion cmd/bookmarks_get_bookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GetBookmark(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:read"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:read"})
if err != nil {
log.WithContext(ctx).WithError(err).WithFields(lf).Error("failed to authenticate")
return 1
Expand Down
4 changes: 2 additions & 2 deletions cmd/changes_end_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func EndChange(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:write"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:write"})
if err != nil {
log.WithContext(ctx).WithFields(lf).WithError(err).Error("failed to authenticate")
return 1
Expand All @@ -83,7 +83,7 @@ func EndChange(ctx context.Context, ready chan bool) int {
ctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_HAPPENING, true)
changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_HAPPENING, viper.GetString("ticket-link"), true)
if err != nil {
log.WithError(err).WithFields(lf).Error("failed to identify change")
return 1
Expand Down
4 changes: 2 additions & 2 deletions cmd/changes_get_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func GetChange(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:read"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:read"})
if err != nil {
log.WithContext(ctx).WithFields(lf).WithError(err).Error("failed to authenticate")
return 1
Expand All @@ -102,7 +102,7 @@ func GetChange(ctx context.Context, ready chan bool) int {
ctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus(sdp.ChangeStatus_value[viper.GetString("status")]), true)
changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus(sdp.ChangeStatus_value[viper.GetString("status")]), viper.GetString("ticket-link"), true)
if err != nil {
log.WithError(err).WithFields(lf).Error("failed to identify change")
return 1
Expand Down
2 changes: 1 addition & 1 deletion cmd/changes_list_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func ListChanges(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:read"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:read"})
if err != nil {
log.WithContext(ctx).WithFields(lf).WithError(err).Error("failed to authenticate")
return 1
Expand Down
4 changes: 2 additions & 2 deletions cmd/changes_manual_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func ManualChange(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:write"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:write"})
if err != nil {
log.WithContext(ctx).WithFields(lf).WithError(err).Error("failed to authenticate")
return 1
Expand All @@ -88,7 +88,7 @@ func ManualChange(ctx context.Context, ready chan bool) int {
defer cancel()

client := AuthenticatedChangesClient(ctx, oi)
changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_DEFINING, false)
changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_DEFINING, viper.GetString("ticket-link"),false)
if err != nil {
log.WithContext(ctx).WithError(err).WithFields(lf).Error("failed to searching for existing changes")
return 1
Expand Down
4 changes: 2 additions & 2 deletions cmd/changes_start_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func StartChange(ctx context.Context, ready chan bool) int {
return 1
}

ctx, err = ensureToken(ctx, oi, []string{"changes:write"})
ctx, _, err = ensureToken(ctx, oi, []string{"changes:write"})
if err != nil {
log.WithContext(ctx).WithFields(lf).WithError(err).Error("failed to authenticate")
return 1
Expand All @@ -83,7 +83,7 @@ func StartChange(ctx context.Context, ready chan bool) int {
ctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_DEFINING, true)
changeUuid, err := getChangeUuid(ctx, oi, sdp.ChangeStatus_CHANGE_STATUS_DEFINING,viper.GetString("ticket-link"), true)
if err != nil {
log.WithError(err).WithFields(lf).Error("failed to identify change")
return 1
Expand Down
Loading

0 comments on commit fa05ea3

Please sign in to comment.