Skip to content

Commit

Permalink
fix: Add file extensions to all files (#830)
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
  • Loading branch information
mateusoliveira43 authored Apr 21, 2023
1 parent cef01bb commit 2441922
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mockoon-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '!mocks/README.md'
- '.github/workflows/mockoon-tests.yml'
- 'Makefile'
- 'scripts/run-mockoon-tests'
- 'scripts/run-mockoon-tests.sh'

pull_request:
paths:
Expand All @@ -16,7 +16,7 @@ on:
- '!mocks/README.md'
- '.github/workflows/mockoon-tests.yml'
- 'Makefile'
- 'scripts/run-mockoon-tests'
- 'scripts/run-mockoon-tests.sh'

jobs:
integration-test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Check Python Formatting
on:
pull_request:
paths:
- 'exporters/**'
- 'pyproject.toml'
- '.github/workflows/python-formatting.yml'
- 'pyproject.toml'
- 'Makefile'
- '**.py'

jobs:
format-check:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/python-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: Pylava
on:
pull_request:
paths:
- 'exporters/**'
- 'scripts/**'
- 'pyproject.toml'
- '.github/workflows/python-linting.yml'
- 'Makefile'
- '**.py'

jobs:
python-lint:
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
name: Shellcheck Tests
on:
push:
# Sync with Makefile and SHELL_SCRIPTS
paths:
- 'demo/demo-tekton.sh'
- 'scripts/create_release_pr'
- 'scripts/install_dev_tools'
- 'scripts/pre-commit'
- 'scripts/run-mockoon-tests'
- 'scripts/run-pelorus-e2e-tests'
- 'scripts/setup-pre-commit-hook'

- '.github/workflows/shellcheck.yml'
- 'Makefile'
- '**.sh'
pull_request:
# Sync with Makefile and SHELL_SCRIPTS
paths:
- 'demo/demo-tekton.sh'
- 'scripts/create_release_pr'
- 'scripts/install_dev_tools'
- 'scripts/pre-commit'
- 'scripts/run-mockoon-tests'
- 'scripts/run-pelorus-e2e-tests'
- 'scripts/setup-pre-commit-hook'
- '.github/workflows/shellcheck.yml'
- 'Makefile'
- '**.sh'

jobs:
unit-test:
Expand All @@ -44,5 +33,4 @@ jobs:
pyproject.toml
- name: Test with shellcheck
run: |
make shellcheck
run: make shellcheck
46 changes: 20 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ endif
CHART_TEST=$(shell which ct)

SHELLCHECK=$(shell which shellcheck)
# Sync with .github/workflows/shellcheck.yaml
SHELL_SCRIPTS=demo/demo-tekton.sh \
scripts/create_release_pr \
scripts/install_dev_tools \
scripts/run-mockoon-tests \
scripts/run-pelorus-e2e-tests

.PHONY: default
default: \
Expand Down Expand Up @@ -79,13 +73,13 @@ pre-commit-setup: $(PELORUS_VENV)
.PHONY: cli_dev_tools
cli_dev_tools: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
./scripts/install_dev_tools -v $(PELORUS_VENV)
./scripts/install_dev_tools.sh -v $(PELORUS_VENV)


# for installing a single CLI dev tool
$(PELORUS_VENV)/bin/%: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
./scripts/install_dev_tools -v $(PELORUS_VENV) -c $(notdir $@)
./scripts/install_dev_tools.sh -v $(PELORUS_VENV) -c $(notdir $@)

# system-level doc requirements
ifeq (Darwin, $(shell uname -s))
Expand All @@ -107,7 +101,7 @@ dev-env: $(PELORUS_VENV) cli_dev_tools exporters git-blame \
## e2e-tests-dev-env: set up environment required to run e2e tests
e2e-tests-dev-env: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
./scripts/install_dev_tools -v $(PELORUS_VENV) -c oc,helm
./scripts/install_dev_tools.sh -v $(PELORUS_VENV) -c oc,helm
$(info **** To run VENV: $$source ${PELORUS_VENV}/bin/activate)
$(info **** To later deactivate VENV: $$deactivate)

Expand All @@ -116,22 +110,22 @@ e2e-tests-dev-env: $(PELORUS_VENV)
.PHONY: major-release minor-release release rc-release

major-release:
./scripts/create_release_pr -x
./scripts/create_release_pr.sh -x

minor-release:
./scripts/create_release_pr -y
./scripts/create_release_pr.sh -y

release:
./scripts/create_release_pr -z
./scripts/create_pelorus_operator -f
./scripts/create_release_pr.sh -z
./scripts/create_pelorus_operator.sh -f

rc-release:
./scripts/create_release_pr -n
./scripts/create_release_pr.sh -n

.PHONY: mockoon-tests
mockoon-tests: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
./scripts/run-mockoon-tests
./scripts/run-mockoon-tests.sh

# End to end tests
## e2e-tests: installs pelorus, mongo-todolist and tests commit and deploy exporters
Expand All @@ -140,15 +134,15 @@ mockoon-tests: $(PELORUS_VENV)
.PHONY: e2e-tests e2e-tests-scenario-1 e2e-tests-scenario-1
e2e-tests: e2e-tests-dev-env
. ${PELORUS_VENV}/bin/activate && \
./scripts/run-pelorus-e2e-tests -o konveyor -a -t
./scripts/run-pelorus-e2e-tests.sh -o konveyor -a -t

e2e-tests-scenario-1: e2e-tests-dev-env
. ${PELORUS_VENV}/bin/activate && \
./scripts/run-pelorus-e2e-tests -f "periodic/quay_images_latest.yaml" -o konveyor -a -t
./scripts/run-pelorus-e2e-tests.sh -f "periodic/quay_images_latest.yaml" -o konveyor -a -t

e2e-tests-scenario-2: e2e-tests-dev-env
. ${PELORUS_VENV}/bin/activate && \
./scripts/run-pelorus-e2e-tests -f "periodic/different_deployment_methods.yaml"
./scripts/run-pelorus-e2e-tests.sh -f "periodic/different_deployment_methods.yaml"

# Integration tests
## integration-tests: pytest everything marked as integration
Expand All @@ -172,7 +166,7 @@ unit-tests: $(PELORUS_VENV)
.PHONY: test-prometheusrules
test-prometheusrules: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
./_test/test_prometheusrules
./_test/test_prometheusrules.sh

# Conf tests
## conf-tests: execute _test/conftest.sh
Expand All @@ -191,19 +185,19 @@ format-check: $(PELORUS_VENV) black-check isort-check

black: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
black exporters scripts docs
black .

black-check: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
black --check exporters scripts docs
black --check .

isort: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
isort exporters scripts docs
isort .

isort-check: $(PELORUS_VENV)
. ${PELORUS_VENV}/bin/activate && \
isort --check exporters scripts docs
isort --check .


# Linting
Expand Down Expand Up @@ -233,9 +227,9 @@ typecheck: $(PELORUS_VENV)

## chart-check-bump: lint helm charts, attempting to bump their versions if required
chart-check-bump: $(PELORUS_VENV)
./scripts/install_dev_tools -v $(PELORUS_VENV) -c ct && \
./scripts/install_dev_tools.sh -v $(PELORUS_VENV) -c ct && \
. ${PELORUS_VENV}/bin/activate && \
./scripts/chart-check-and-bump
./scripts/chart-check-and-bump.py

chart-lint: $(PELORUS_VENV) $(PELORUS_VENV)/bin/ct $(PELORUS_VENV)/bin/helm
. ${PELORUS_VENV}/bin/activate && \
Expand All @@ -252,7 +246,7 @@ shellcheck: $(PELORUS_VENV) $(PELORUS_VENV)/bin/shellcheck
. ${PELORUS_VENV}/bin/activate && \
if [[ -z shellcheck ]]; then echo "Shellcheck is not installed" >&2; false; fi && \
echo "🐚 📋 Linting shell scripts with shellcheck" && \
shellcheck $(SHELL_SCRIPTS)
shellcheck $(shell find -name '*.sh' -type f | grep -v 'venv/\|git/\|.pytest_cache/\|htmlcov/\|_test/test_helper/\|_test/bats\|_test/conftest')

ifneq (, $(SHELLCHECK))
shellcheck-optional: shellcheck
Expand Down
6 changes: 3 additions & 3 deletions _test/bats-support-clone.bash → _test/bats-support-clone.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if [[ ! -d "_test/test_helper/bats-support" ]]; then
# Download bats-support dynamically so it doesnt need to be added into source
# Download bats-support dynamically so it doesn't need to be added into source
git clone https://github.com/ztombol/bats-support _test/test_helper/bats-support --depth 1
fi

if [[ ! -d "_test/test_helper/redhatcop-bats-library" ]]; then
# Download redhat-cop/bats-library dynamically so it doesnt need to be added into source
# Download redhat-cop/bats-library dynamically so it doesn't need to be added into source
git clone https://github.com/redhat-cop/bats-library _test/test_helper/redhatcop-bats-library --depth 1
fi
fi
2 changes: 1 addition & 1 deletion _test/conftest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bats

load bats-support-clone
load bats-support-clone.sh
load test_helper/bats-support/load
load test_helper/redhatcop-bats-library/load

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ You can check all chart versions and bump them if needed with a script that comp

or bump specific charts with shell script:

$ ./scripts/bump-version CHART_PATH [ CHART_PATH ...]
$ ./scripts/bump-version.py CHART_PATH [ CHART_PATH ...]

## Dashboard Development

Expand Down Expand Up @@ -489,7 +489,7 @@ Webhook type exporter has an additional URL target http://localhost:8080/pelorus

To create a new version (or candidate) of Pelorus operator you must be logged into `podman` (`podman login` command) and `OpenShift` (`oc login` command) and then run
```
rm -rf pelorus-operator && mkdir pelorus-operator && scripts/create_pelorus_operator
rm -rf pelorus-operator && mkdir pelorus-operator && scripts/create_pelorus_operator.sh
```
This will update `pelorus-operator` folder with the updates.
Expand Down Expand Up @@ -625,7 +625,7 @@ Then, log in to your OpenShift cluster and **ENSURE** your pelorus namespace doe
```
make e2e-tests
```
which is an alias to `./scripts/run-pelorus-e2e-tests -o konveyor -a -t`
which is an alias to `./scripts/run-pelorus-e2e-tests.sh -o konveyor -a -t`

To run e2e-tests from current branch, first create a PR in Pelorus project for it and export the necessary environment variables to run the script, by running
```shell
Expand All @@ -635,7 +635,7 @@ export PULL_NUMBER=<THE_PR_NUMBER>

For more information, run
```
./scripts/run-pelorus-e2e-tests -h
./scripts/run-pelorus-e2e-tests.sh -h
```

To delete the objects created by the script, run
Expand Down
4 changes: 2 additions & 2 deletions docs/UpstreamSupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ Number of [Pelorus jobs](https://prow.ci.openshift.org/?job=*pelorus*) are runni

Similarly to the [GitHub Actions](#github-actions) those jobs uses [Makefile](https://github.com/dora-metrics/pelorus/blob/master/Makefile) as the entry point for execution.

E2E Pull Request jobs consumes Pelorus deployment files, which are defined in the [mig-demo-apps values.yaml](https://github.com/dora-metrics/mig-demo-apps/blob/master/apps/todolist-mongo-go/pelorus/values.yaml) project and requires secrets that are configured using [vault.ci.openshift.org](https://vault.ci.openshift.org). Those secrets are then mounted by the [Prow job definition](https://github.com/openshift/release/blob/master/ci-operator/config/konveyor/pelorus/konveyor-pelorus-master__4.11.yaml#L122-L124) and used by the [Pelorus E2E script](https://github.com/dora-metrics/pelorus/blob/master/scripts/run-pelorus-e2e-tests).
E2E Pull Request jobs consumes Pelorus deployment files, which are defined in the [mig-demo-apps values.yaml](https://github.com/konveyor/mig-demo-apps/blob/master/apps/todolist-mongo-go/pelorus/values.yaml) project and requires secrets that are configured using [vault.ci.openshift.org](https://vault.ci.openshift.org). Those secrets are then mounted by the [Prow job definition](https://github.com/openshift/release/blob/master/ci-operator/config/konveyor/pelorus/konveyor-pelorus-master__4.11.yaml#L122-L124) and used by the [Pelorus E2E script](https://github.com/dora-metrics/pelorus/blob/master/scripts/run-pelorus-e2e-tests.sh).

E2E periodic jobs uses deployment files defined in the [mig-demo-apps periodic folder](https://github.com/konveyor/mig-demo-apps/tree/master/apps/todolist-mongo-go/pelorus/periodic). Secrets and invocation script are identical to the Pull Request jobs differing in the [Makefile](https://github.com/dora-metrics/pelorus/blob/master/Makefile) targets, which uses different arguments passed to the [Pelorus E2E script](https://github.com/dora-metrics/pelorus/blob/master/scripts/run-pelorus-e2e-tests).
E2E periodic jobs uses deployment files defined in the [mig-demo-apps periodic folder](https://github.com/konveyor/mig-demo-apps/tree/master/apps/todolist-mongo-go/pelorus/periodic). Secrets and invocation script are identical to the Pull Request jobs differing in the [Makefile](https://github.com/dora-metrics/pelorus/blob/master/Makefile) targets, which uses different arguments passed to the [Pelorus E2E script](https://github.com/dora-metrics/pelorus/blob/master/scripts/run-pelorus-e2e-tests.sh).

Exporters list covered by the Prow CI is available in the [Backend Exporters](#backend-exporters) section.

Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions scripts/chart-lint

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ fi

echo "INFO: Adding replaces and skips entries to ${source_dir}${destination_dir}/bundle/manifests/charts.pelorus.dora-metrics.io_pelorus.yaml"
set -e
# shellcheck disable=SC2086 # We need to expand $OPERATOR_VERSIONS
$SCRIPT_DIR/specify_operator_update.py $NEW_OPERATOR_VERSION $destination_dir $OPERATOR_VERSIONS

echo "INFO: Current operator version: ${OPERATOR_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/create_release_pr → scripts/create_release_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ if [ "$NO_VERSIONS" -ne 1 ]; then
exit 1
fi

printf "\nIMPORTANT:\n\t Update the operator files using ./scripts/create_pelorus_operator script.\n\n"
printf "\nIMPORTANT:\n\t Update the operator files using ./scripts/create_pelorus_operator.sh script.\n\n"

if [[ $x_ver ]]; then
printf "\nIMPORTANT:\n\t Do include \"major release\" text in the first line of your commit message, or label your PR with: \"major\"\n\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function print_help() {
printf "\t -b\tbinary build app name\n"
printf "\t -u\tgit uri to be used for annotation\n"
printf "\t -s\tgit commit hash to be used for annotation\n"

exit 0
}

Expand All @@ -60,7 +60,7 @@ while getopts "h?cb:n:u:s:" option; do
b) s_build_app_name=$OPTARG;;
u) s_git_uri=$OPTARG;;
s) s_git_hash=$OPTARG;;

esac
done

Expand All @@ -70,7 +70,6 @@ fi

if [ "${s_cleanup}" == true ]; then
cleanup_and_exit
exit 0
fi

# build_app_name is not required for cleanup, however we do need
Expand All @@ -90,8 +89,10 @@ oc new-build --namespace="${s_build_namespace}" python --name="${s_build_app_nam
oc label --namespace="${s_build_namespace}" bc "${s_build_app_name}" app.kubernetes.io/name="${s_build_app_name}"

# To ensure ./app.py is found
# shellcheck disable=SC2164
pushd "$(dirname "$0")"
oc start-build --namespace="${s_build_namespace}" bc/"${s_build_app_name}" --from-file=./app.py --follow
# shellcheck disable=SC2164
popd

set -x
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PROW_SECRETS_DIR="/var/run/konveyor/pelorus/pelorus-github/"
PROW_S3_SECRETS_DIR="/var/run/konveyor/pelorus/pelorus-s3amazon/"

# Binary build script
BINARY_BUILD_SCRIPT="${SCRIPT_DIR}/e2e-tests-templates/build_binary_app"
BINARY_BUILD_SCRIPT="${SCRIPT_DIR}/e2e-tests-templates/build_binary_app.sh"


# Used to download required files prior to running the job
Expand Down

0 comments on commit 2441922

Please sign in to comment.