Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/fs-extra-11.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nickboldt authored Sep 22, 2023
2 parents 8be5c43 + 002c761 commit 15c7f46
Show file tree
Hide file tree
Showing 41 changed files with 3,695 additions and 978 deletions.
5 changes: 4 additions & 1 deletion .ci/oc-test-happy-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ EOF
--telemetry off \
--batch

export HAPPY_PATH_SUITE=test-empty-workspace-devworkspace-happy-path-code
alias chectl=$(pwd)/bin/run

export HAPPY_PATH_USERSTORY=EmptyWorkspace
export HAPPY_PATH_SUITE=test
bash <(curl -s ${DEVWORKSPACE_HAPPY_PATH}/remote-launch.sh)
}

Expand Down
25 changes: 20 additions & 5 deletions .ci/openshift-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2021 Red Hat, Inc.
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -11,9 +11,24 @@
#

# Dockerfile to bootstrap build and test in openshift-ci
FROM registry.access.redhat.com/ubi9/nodejs-18:1
# hadolint ignore=DL3002
USER 0

FROM registry.ci.openshift.org/openshift/release:golang-1.18
# hadolint ignore=DL3041
RUN dnf install -y -q --allowerasing --nobest nodejs-devel nodejs-libs python3-pip jq \
# already installed or installed as deps:
openssl openssl-devel ca-certificates make cmake cpp gcc gcc-c++ zlib zlib-devel brotli brotli-devel python3 nodejs-packaging && \
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
pip3 install yq && \
dnf update -y && dnf clean all && \
npm install -g [email protected] npm@9 && \
echo -n "node version: "; node -v; \
echo -n "npm version: "; npm -v; \
echo -n "yarn version: "; yarn -v

RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash - && \
yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo && \
yum install -y yarn
# to build chectl in this container, uncomment these lines
# resulting tarball will be in /opt/app-root/src/chectl*.tgz
# COPY . /opt/app-root/src
# RUN yarn && yarn pack && yarn test
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Global Owners
* @tolusha @AndrienkoAleksandr @flacatus
* @tolusha @l0rd @ibuziuk

2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 16.13.2
node-version: 18.16.1
- name: Build chectl
run: yarn
- name: Install codecov
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/minikube-chectl-commands-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13.2
node-version: 18.16.1
- name: Build chectl
run: yarn
- name: Run e2e tests
Expand Down Expand Up @@ -57,13 +57,13 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13.2
node-version: 18.16.1
- name: Build chectl
run: yarn
- name: Run tests
run: |
export PLATFORM=minikube
yarn test --coverage=false --forceExit --testRegex=test/e2e/e2e-upgrade.test.ts
yarn test --coverage=false --forceExit --testRegex=test/e2e/e2e-upgrade-version.test.ts
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/minikube-chectl-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13.2
- name: Pack chectl binaries
run: yarn && npx oclif-dev pack --targets=linux-x64
- name: UnPack chectl binaries in $HOME/chectl
node-version: 18.16.1
- name: Pack chectl binary (single arch target)
run: yarn && yarn prepack && yarn pack-binaries --targets=linux-x64
- name: Unpack chectl tarball to $HOME/chectl
run: |
# Will unpack chectl binaries in $HOME/chectl
tar -xvf dist/channels/*/chectl-linux-x64.tar.gz -C $HOME
tar -xvf $(find dist/ -name "chectl*linux-x64.tar.gz" | head -1) -C $HOME
echo "$HOME/chectl/bin" >> $GITHUB_PATH
rm -rf tmp/
- name: Run tests
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13.2
- name: Build chectl
node-version: 18.16.1
- name: Install yarn deps
run: yarn
- name: Run eslint
run: yarn lint
Expand All @@ -42,17 +42,17 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13
- name: Build chectl
run: yarn
node-version: 18.16.1
- name: Build chectl and pack binaries
run: yarn && yarn pack-binaries --targets=linux-x64
- name: Build README.md
run: yarn oclif-dev readme
run: DEBUG=* npx oclif readme
- name: Check README.md state
run: |
IFS=$'\n' read -d '' -r -a FILES_CHANGED_ARRAY < <( git ls-files -m ) || true
# check if readme it is up to date
if [[ " ${FILES_CHANGED_ARRAY[@]} " =~ "README.md" ]]; then
echo "[ERROR] README.md it is not up to date. Please run 'yarn oclif-dev readme' to update and commit the changes."
echo "[ERROR] README.md it is not up to date. Please run 'yarn oclif readme' to update and commit the changes."
exit 1
fi
license-validation:
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.16.1
- name: Build chectl
run: yarn
- name: Set up Go 1.15
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/release-announce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Red Hat, Inc. - initial API and implementation
#

name: Release - announce in mattermost
name: Release
on:
# Trigger the workflow on tag creation only
push:
Expand All @@ -29,27 +29,13 @@ jobs:
id: TAG_UTIL
run: |
if [[ ${GITHUB_REF#refs/tags/} =~ 7.*.* ]]; then
echo "::set-output name=chectl_version::$(cat VERSION)"
echo "::set-output name=gh_tag::/tag/$(cat VERSION)"
echo "chectl_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "gh_tag=/tag/$(cat VERSION)" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=true" >> "$GITHUB_ENV"
elif [[ ${{ github.event.inputs.version }} =~ 7.*.* ]]; then
echo "::set-output name=chectl_version::${{ github.event.inputs.version }}"
echo "::set-output name=gh_tag::/tag/${{ github.event.inputs.version }}"
echo "chectl_version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "gh_tag=/tag/${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=true" >> "$GITHUB_ENV"
else
echo "MM_ANNOUNCE=false" >> "$GITHUB_ENV"
fi
- name: Create success MM message
run: |
echo "{\"text\":\":white_check_mark: Chectl ${{ steps.TAG_UTIL.outputs.chectl_version }} released! https://github.com/che-incubator/chectl/releases${{ steps.TAG_UTIL.outputs.gh_tag }}\"}" > mattermost.json
- name: Create failure message
if: ${{ failure() }}
run: |
echo "{\"text\":\":che-logo: Problem with chectl ${{ steps.TAG_UTIL.outputs.chectl_version }} release!\n\n \"}" > mattermost.json
- name: Send MM message
if: ${{ env.MM_ANNOUNCE == 'true' }}
uses: mattermost/[email protected]
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: eclipse-che-releases
MATTERMOST_USERNAME: che-bot
32 changes: 9 additions & 23 deletions .github/workflows/release-build-and-push-to-GH-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.16.1
- name: Generate tag utilities
id: TAG_UTIL
run: |
if [[ ${GITHUB_REF#refs/heads/} =~ 7.* ]]; then
echo "::set-output name=chectl_version::$(cat VERSION)"
echo "::set-output name=gh_release_name::$(cat VERSION)"
echo "::set-output name=gh_tag::$(cat VERSION)"
echo "chectl_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "gh_release_name=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "gh_tag=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=true" >> "$GITHUB_ENV"
elif [[ ${GITHUB_REF#refs/heads/} =~ main ]]; then
CURRENT_DAY=$(date +'%Y%m%d')
SHORT_SHA1=$(git rev-parse --short HEAD)
echo "::set-output name=gh_tag::$(date +'%Y%m%d%H%M%S')"
echo "::set-output name=chectl_version::0.0.$CURRENT_DAY-next"
echo "::set-output name=gh_release_name::0.0.$CURRENT_DAY-next.$SHORT_SHA1"
echo "gh_tag=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "chectl_version=0.0.$CURRENT_DAY-next" >> $GITHUB_OUTPUT
echo "gh_release_name=0.0.$CURRENT_DAY-next.$SHORT_SHA1" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=false" >> "$GITHUB_ENV"
fi
- name: Build chectl
Expand All @@ -59,13 +59,13 @@ jobs:
git tag ${{ steps.TAG_UTIL.outputs.gh_tag }}
TARGETS=linux-arm,linux-x64,linux-s390x,linux-ppc64le,darwin-x64,darwin-arm64,win32-x64,win32-x86
npx oclif-dev pack --targets=$TARGETS
yarn prepack && yarn pack-binaries --targets=$TARGETS
- name: Create Release and push artifacts
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.TAG_UTIL.outputs.gh_release_name }}
tag_name: ${{ steps.TAG_UTIL.outputs.gh_tag }}
files: "./dist/channels/**/chectl-*.gz"
files: "./dist/chectl-*.gz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update github pages
Expand All @@ -81,17 +81,3 @@ jobs:
BRANCH: gh-pages
FOLDER: gh-pages
CLEAN: true # Automatically remove deleted files from the deploy branch
- name: Create success MM message
run: |
echo "{\"text\":\":white_check_mark: Chectl ${{ steps.TAG_UTIL.outputs.chectl_version }} released: https://github.com/che-incubator/chectl/releases${{ steps.TAG_UTIL.outputs.gh_tag }}\"}" > mattermost.json
- name: Create failure message
if: ${{ failure() }}
run: |
echo "{\"text\":\":che-logo: Problem with chectl ${{ steps.TAG_UTIL.outputs.chectl_version }} release.\n\n \"}" > mattermost.json
- name: Send MM message
if: ${{ env.MM_ANNOUNCE == 'true' }}
uses: mattermost/[email protected]
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: eclipse-che-releases
MATTERMOST_USERNAME: che-bot
17 changes: 2 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.13
node-version: 18.16.1
- name: Check existing tags
run: |
set +e
Expand Down Expand Up @@ -70,17 +70,4 @@ jobs:
else
./make-release.sh --version ${{ github.event.inputs.version }} --devworkspace-operator-version ${DWO_VERSION}
fi
- name: Create failure MM message
if: ${{ failure() }}
run: |
echo "{\"text\":\":no_entry_sign: Chectl ${{ github.event.inputs.version }} release PR creation failed: https://github.com/che-incubator/chectl/actions/workflows/release.yml\"}" > mattermost.json
- name: Create success MM message
run: |
echo "{\"text\":\":white_check_mark: Chectl ${{ github.event.inputs.version }} release PR has been created: https://github.com/che-incubator/chectl/pulls?q=is%3Aopen+is%3Apr+${{ github.event.inputs.version }}\"}" > mattermost.json
- name: Send MM message
if: ${{ success() }} || ${{ failure() }}
uses: mattermost/[email protected]
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: eclipse-che-releases
MATTERMOST_USERNAME: che-bot
2 changes: 0 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
Expand All @@ -35,7 +34,6 @@
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
Expand Down
Loading

0 comments on commit 15c7f46

Please sign in to comment.