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

feat(convert)!: Remove monaco convert #1680

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .ci/nightly.groovy
Copy link
Contributor

Choose a reason for hiding this comment

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

not related to this PR.
Can I remove this jenkins pipeline? I think it's obsolete.

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ pipeline {
}
}

stage("🧓 Integration test (legacy)") {
steps {
executeWithSecrets(cmd: 'make integration-test-v1')
}
}

stage("📥/📤 Download/Restore test") {
steps {
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/end-to-end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,48 +102,6 @@ jobs:
name: Test Results - Integration
path: test-result-*.xml


legacy-integration-tests:
name: 🧓 Legacy integration tests
needs: [setup]
if: github.event.action != 'labeled' || github.event.label.name == 'run-e2e-test'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
ref: ${{needs.setup.outputs.sha}}

- name: Set up Go 1.x
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 #v5.3.0
with:
go-version: '~1.23'

- name: 🧓 Integration test (legacy)
run: make integration-test-v1 testopts="--junitfile test-result-integration-legacy.xml"
env:
URL_ENVIRONMENT_1: ${{ secrets.URL_ENVIRONMENT_1 }}
URL_ENVIRONMENT_2: ${{ secrets.URL_ENVIRONMENT_2 }}
TOKEN_ENVIRONMENT_1: ${{ secrets.TOKEN_ENVIRONMENT_1 }}
TOKEN_ENVIRONMENT_2: ${{ secrets.TOKEN_ENVIRONMENT_2 }}
PLATFORM_URL_ENVIRONMENT_1: ${{ secrets.PLATFORM_URL_ENVIRONMENT_1 }}
PLATFORM_URL_ENVIRONMENT_2: ${{ secrets.PLATFORM_URL_ENVIRONMENT_2 }}
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
OAUTH_TOKEN_ENDPOINT: ${{ secrets.OAUTH_TOKEN_ENDPOINT }}

- name: ⬆️ Upload Test Results
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
if: always()
with:
name: Test Results - Integration Legacy
path: test-result-*.xml


download-restore-test:
name: 📥/📤 Download-restore-test
needs: [setup]
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BINARY_NAME ?= monaco
VERSION ?= 2.x
RELEASES = $(BINARY_NAME)-windows-amd64.exe $(BINARY_NAME)-windows-386.exe $(BINARY_NAME)-linux-arm64 $(BINARY_NAME)-linux-amd64 $(BINARY_NAME)-linux-386 $(BINARY_NAME)-darwin-amd64 $(BINARY_NAME)-darwin-arm64

.PHONY: lint format mocks build install clean test integration-test integration-test-v1 test-package default add-license-headers compile build-release $(RELEASES) docker-container sign-image install-ko
.PHONY: lint format mocks build install clean test integration-test test-package default add-license-headers compile build-release $(RELEASES) docker-container sign-image install-ko

default: build

Expand Down Expand Up @@ -95,9 +95,6 @@ test: mocks install-gotestsum
integration-test: mocks install-gotestsum
@gotestsum ${testopts} --format testdox -- -tags=integration -timeout=30m -v -race ./cmd/monaco/integrationtest/v2

integration-test-v1: mocks install-gotestsum
@gotestsum ${testopts} --format testdox -- -tags=integration_v1 -timeout=30m -v -race ./cmd/monaco/integrationtest/v1

download-restore-test: mocks install-gotestsum
@gotestsum ${testopts} --format testdox -- -tags=download_restore -timeout=30m -v -race ./...

Expand Down
47 changes: 8 additions & 39 deletions cmd/monaco/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@
package completion

import (
"os"
"strings"

"github.com/spf13/pflag"
"golang.org/x/exp/maps"

"github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/files"
"github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/slices"
manifestloader "github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/manifest/loader"
"github.com/spf13/pflag"
"golang.org/x/exp/maps"
"os"
"strings"

"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/api"
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/api"
)

func DeleteCompletion(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
Expand All @@ -52,24 +55,6 @@ func SingleArgumentManifestFileCompletion(_ *cobra.Command, args []string, _ str
}
}

func DownloadManifestCompletion(c *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) == 0 {
return files.YamlExtensions, cobra.ShellCompDirectiveFilterFileExt
} else if len(args) == 1 {
return EnvironmentByArg0(c, args, toComplete)
} else {
return make([]string, 0), cobra.ShellCompDirectiveNoFileComp
}
}

func DownloadDirectCompletion(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
if len(args) == 1 {
return listEnvVarNames(), cobra.ShellCompDirectiveDefault
} else {
return make([]string, 0), cobra.ShellCompDirectiveNoFileComp
}
}

func PurgeCompletion(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
if len(args) == 0 {
return files.YamlExtensions, cobra.ShellCompDirectiveFilterFileExt
Expand All @@ -87,14 +72,6 @@ func listEnvVarNames() []string {
return names
}

func ConvertCompletion(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
if len(args) == 0 {
return EnvironmentFile()
} else {
return make([]string, 0), cobra.ShellCompDirectiveFilterDirs
}
}

func AllAvailableApis(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
value, ok := cmd.Flag("api").Value.(pflag.SliceValue)
if !ok {
Expand Down Expand Up @@ -127,10 +104,6 @@ func AccountsByManifestFlag(cmd *cobra.Command, _ []string, _ string) ([]string,
return loadAccountsFromManifest(cmd.Flag("manifest").Value.String())
}

func AccountsByArg0(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
return loadAccountsFromManifest(args[0])
}

func loadAccountsFromManifest(manifestPath string) ([]string, cobra.ShellCompDirective) {
man, _ := manifestloader.Load(&manifestloader.Context{
Fs: afero.NewOsFs(),
Expand Down Expand Up @@ -164,10 +137,6 @@ func DeleteFile() ([]string, cobra.ShellCompDirective) {
return deepFileSearch(".", "delete.yaml"), cobra.ShellCompDirectiveDefault
}

func EnvironmentFile() ([]string, cobra.ShellCompDirective) {
return files.YamlExtensions, cobra.ShellCompDirectiveFilterFileExt
}

func deepFileSearch(root, ext string) []string {

var allMatchingFiles []string
Expand Down
80 changes: 0 additions & 80 deletions cmd/monaco/convert/command.go

This file was deleted.

Loading
Loading