Skip to content

Commit

Permalink
Merge pull request #436 from vshn/remove-packages
Browse files Browse the repository at this point in the history
Remove syn package feature
  • Loading branch information
zugao authored Aug 8, 2024
2 parents ce6a529 + 6983ffc commit 81246fd
Show file tree
Hide file tree
Showing 861 changed files with 14,853 additions and 763 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3


# detect if specific yaml key exists in file ../../component/class/defaults.yaml
# detect if specific yaml key exists in file ../../class/defaults.yaml
# specifically find existing passwords and fail if they're non empty

import yaml
Expand All @@ -15,8 +15,8 @@ def yaml_path_recursion(yaml_dict, path):
return yaml_path_recursion(yaml_dict.get(path[0], {}), path[1:])

current_dir = os.path.dirname(os.path.realpath(__file__))
tests_vshn_file = os.path.join(current_dir, '../../component/tests/vshn.yml')
defaults_file = os.path.join(current_dir, '../../component/class/defaults.yml')
tests_vshn_file = os.path.join(current_dir, '../../tests/vshn.yml')
defaults_file = os.path.join(current_dir, '../../class/defaults.yml')


keys_to_check_yaml = [
Expand Down
73 changes: 0 additions & 73 deletions .github/workflows/component-test.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/package-test.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,3 @@ jobs:
# Ensure target branch for release is "master"
commit: master
token: ${{ secrets.GITHUB_TOKEN }}
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'master'
token: ${{ secrets.GH_ACTION_PAT }}
- name: set tag env
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Change version in package
run: |
yq -i '.parameters."pkg.appcat".componentVersion = "${{ env.TAG_VERSION }}"' package/main.yaml
- uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GH_ACTION_PAT }}
message: "Update component version in package to ${{ env.TAG_VERSION }}"
branch: 'master'
68 changes: 61 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,75 @@
name: Pull Request (global lints)

name: Pull Request
on:
pull_request:
branches:
- master

env:
COMPONENT_NAME: appcat

jobs:
linting:
runs-on: ubuntu-latest
strategy:
matrix:
command:
- lint_jsonnet
- lint_yaml
- lint_adoc
steps:
- uses: actions/checkout@v4
- name: Run Asciidoc linter
run: make lint_adoc
- name: Run ${{ matrix.command }}
run: make ${{ matrix.command }}

editorconfig:
test:
runs-on: ubuntu-latest
strategy:
matrix:
instance:
- defaults
- exoscale
- cloudscale
- openshift
- vshn
- apiserver
- controllers
- minio
- cloudscale-metrics-collector-cloud
- cloudscale-metrics-collector-managed
- exoscale-metrics-collector-cloud
- exoscale-metrics-collector-managed
defaults:
run:
working-directory: ${{ env.COMPONENT_NAME }}
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.COMPONENT_NAME }}
- name: Compile component
run: make test -e instance=${{ matrix.instance }}
golden:
runs-on: ubuntu-latest
strategy:
matrix:
instance:
- defaults
- exoscale
- cloudscale
- openshift
- vshn
- apiserver
- controllers
- minio
- cloudscale-metrics-collector-cloud
- cloudscale-metrics-collector-managed
- exoscale-metrics-collector-cloud
- exoscale-metrics-collector-managed
defaults:
run:
working-directory: ${{ env.COMPONENT_NAME }}
steps:
- uses: actions/checkout@v4
- uses: snow-actions/[email protected]
with:
args: "check"
path: ${{ env.COMPONENT_NAME }}
- name: Golden diff
run: make golden-diff -e instance=${{ matrix.instance }}
26 changes: 6 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,14 @@ sloth-input/
sloth-output/

# Commodore
/component/.cache
/component/dependencies
/component/helmcharts
/component/manifests
/component/vendor
/component/jsonnetfile.lock.json
/component/crds
/component/compiled

/package/.cache
/packages/compiled
/package/dependencies
/package/helmcharts
/package/manifests
/package/vendor
/package/jsonnetfile.lock.json
/package/crds
/package/compiled

/compiled
/.cache
/dependencies
/helmcharts
/manifests
/vendor
/jsonnetfile.lock.json
/crds
/compiled

# Additional entries
kubeconfig
8 changes: 7 additions & 1 deletion package/.yamllint.yml → .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rules:
max: 80
level: warning


# Forbid octal literals until we've fully migrated to reclass-rs
octal-values:
forbid-implicit-octal: true
Expand All @@ -16,8 +17,13 @@ rules:
allowed-values: ["true", "false", "True", "False", "TRUE", "FALSE"]
check-keys: true

indentation:
spaces: 2
indent-sequences: whatever

ignore: |
dependencies/
helmcharts/
manifests/
vendor/
compiled/
tests/golden/
65 changes: 65 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,75 @@ all: help
help: ## Show this help
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = "(: ).*?## "}; {gsub(/\\:/,":", $$1)}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: all
all: lint

.PHONY: lint
lint: lint_jsonnet lint_yaml lint_adoc lint_kubent ## All-in-one linting

.PHONY: lint_jsonnet
lint_jsonnet: $(JSONNET_FILES) ## Lint jsonnet files
$(JSONNET_DOCKER) $(JSONNETFMT_ARGS) --test -- $?

.PHONY: lint_yaml
lint_yaml: ## Lint yaml files
$(YAMLLINT_DOCKER) -f parsable -c $(YAMLLINT_CONFIG) $(YAMLLINT_ARGS) -- .

.PHONY: lint_adoc
lint_adoc: ## Lint documentation
$(VALE_CMD) $(VALE_ARGS)

.PHONY: lint_kubent
lint_kubent: ## Lint deprecated Kubernetes API versions
$(KUBENT_DOCKER) $(KUBENT_ARGS) -f $(KUBENT_FILES)

.PHONY: format
format: format_jsonnet ## All-in-one formatting

.PHONY: format_jsonnet
format_jsonnet: $(JSONNET_FILES) ## Format jsonnet files
$(JSONNET_DOCKER) $(JSONNETFMT_ARGS) -- $?

.PHONY: docs-serve
docs-serve: ## Preview the documentation
$(ANTORA_PREVIEW_CMD)

.PHONY: compile
.compile:
mkdir -p dependencies
$(COMPILE_CMD)

.PHONY: test
test: commodore_args += -f tests/$(instance).yml
test: .compile ## Compile the component
.PHONY: gen-golden
gen-golden: commodore_args += -f tests/$(instance).yml
gen-golden: clean .compile ## Update the reference version for target `golden-diff`.
@rm -rf tests/golden/$(instance)
@mkdir -p tests/golden/$(instance)
@cp -R compiled/. tests/golden/$(instance)/.

.PHONY: golden-diff
golden-diff: commodore_args += -f tests/$(instance).yml
golden-diff: clean .compile ## Diff compile output against the reference version. Review output and run `make gen-golden golden-diff` if this target fails.
@git diff --exit-code --minimal --no-index -- tests/golden/$(instance) compiled/

.PHONY: golden-diff-all
golden-diff-all: recursive_target=golden-diff
golden-diff-all: $(test_instances) ## Run golden-diff for all instances. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).

.PHONY: gen-golden-all
gen-golden-all: recursive_target=gen-golden
gen-golden-all: $(test_instances) ## Run gen-golden for all instances. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).

.PHONY: lint_kubent_all
lint_kubent_all: recursive_target=lint_kubent
lint_kubent_all: $(test_instances) ## Lint deprecated Kubernetes API versions for all golden test instances. Will exit on first error. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).

.PHONY: $(test_instances)
$(test_instances):
$(MAKE) $(recursive_target) -e instance=$(basename $(@F))

.PHONY: clean
clean: ## Clean the project
rm -rf .cache compiled dependencies vendor helmcharts jsonnetfile*.json || true
Loading

0 comments on commit 81246fd

Please sign in to comment.