Skip to content

Commit 746e7d8

Browse files
authored
Merge branch 'main' into RHIDP-4569-Discover-Benefits-of-RHDH
2 parents 42f9927 + 8e6a217 commit 746e7d8

File tree

14 files changed

+95
-27
lines changed

14 files changed

+95
-27
lines changed

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
echo "✓"
4949
5050
adoc_build:
51-
name: Asciidoctor Build For PR branch preview
51+
name: Ccutil Build For PR branch preview
5252
runs-on: ubuntu-latest
5353
needs: authorize
5454
permissions:
@@ -69,13 +69,13 @@ jobs:
6969
# update
7070
sudo apt-get update -y || true
7171
# install
72-
sudo apt-get -y -q install asciidoctor && asciidoctor --version
72+
sudo apt-get -y -q install podman && podman --version
7373
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
7474
7575
- name: Build guides and indexes
7676
run: |
7777
echo "Building PR ${{ github.event.pull_request.number }}"
78-
build/scripts/build.sh -b "pr-${{ github.event.number }}"
78+
build/scripts/build-ccutil.sh -b "pr-${{ github.event.number }}"
7979
8080
- name: Pull from origin before pushing (if possible)
8181
run: |

.github/workflows/style-guide.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Verify style guide compliance on pull request
3+
on: [pull_request]
4+
5+
jobs:
6+
vale:
7+
name: Linting with Vale
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Install Asciidoctor
13+
run: sudo apt-get install -y asciidoctor
14+
- name: Run Vale on new and modified content
15+
uses: errata-ai/[email protected]
16+
with:
17+
files: assemblies
18+
vale_flags: "--minAlertLevel=warning"
19+
reporter: github-pr-review
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}
22+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
titles/*/build
33
index.html
44
titles-generated/
5-
.vale.ini
65
.vale-styles/RedHat
76
.vscode
87
.cache/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; .vale.ini
2+
; Specifies Vale configuration
3+
; See: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/user-guide/installing-vale-cli/
4+
;
5+
; Download and search Vale styles in this directory:
6+
StylesPath = ../..
7+
; Minimum alert level to display:
8+
MinAlertLevel = suggestion
9+
; Display alerts on AsciiDoc files:
10+
[*.adoc]
11+
; Apply these styles:
12+
BasedOnStyles = DeveloperHub

.vale.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .vale.ini
2+
# Specifies Vale configuration
3+
# See: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/user-guide/installing-vale-cli/
4+
#
5+
6+
# Download and search Vale styles in this directory:
7+
StylesPath = ".vale-styles"
8+
9+
# Minimum alert level to display:
10+
MinAlertLevel = suggestion
11+
12+
# Styles to download:
13+
Packages = RedHat
14+
15+
# Display alerts on AsciiDoc files:
16+
[*.adoc]
17+
# Apply these styles:
18+
BasedOnStyles = RedHat,DeveloperHub

artifacts/attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
:osd-short: OpenShift Dedicated
2929
// minimum and current latest supported versions
3030
:ocp-version-min: 4.14
31-
:ocp-version: 4.16
31+
:ocp-version: 4.17
3232
// First mention of OpenShift CLI or `oc` in a module
3333
:openshift-cli: pass:quotes[OpenShift CLI (`oc`)]
3434
:rhsso-brand-name: Red Hat Single-Sign On

assemblies/images

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/dynamic-plugins/ref-community-plugins.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Details on how {company-name} provides support for bundled community dynamic plu
5959
`AZURE_ORG`
6060

6161

62-
|Azure Repositories |`https://npmjs.com/package/@parfuemerie/douglas-scaffolder-backend-module-azure-repositories/v/0.3.0[@parfuemerie/douglas-scaffolder-backend-module-azure-repositories]` |0.3.0
62+
|Azure Repositories |`https://npmjs.com/package/@parfuemerie-douglas/scaffolder-backend-module-azure-repositories/v/0.3.0[@parfuemerie-douglas/scaffolder-backend-module-azure-repositories]` |0.3.0
6363
|`./dynamic-plugins/dist/parfuemerie-douglas-scaffolder-backend-module-azure-repositories`
6464

6565

modules/dynamic-plugins/rhdh-supported-plugins.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"Azure ","@backstage/plugin-scaffolder-backend-module-azure","Backend","0.1.14","Community Support","./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-azure-dynamic",";","Disabled"
2828
"Azure Devops ","@backstage/plugin-azure-devops","Frontend","0.4.4","Community Support","./dynamic-plugins/dist/backstage-plugin-azure-devops",";","Disabled"
2929
"Azure Devops ","@backstage/plugin-azure-devops-backend","Backend","0.6.5","Community Support","./dynamic-plugins/dist/backstage-plugin-azure-devops-backend-dynamic","`AZURE_TOKEN`;`AZURE_ORG`;","Disabled"
30-
"Azure Repositories ","@parfuemerie/douglas-scaffolder-backend-module-azure-repositories","Backend","0.3.0","Community Support","./dynamic-plugins/dist/parfuemerie-douglas-scaffolder-backend-module-azure-repositories",";","Disabled"
30+
"Azure Repositories ","@parfuemerie-douglas/scaffolder-backend-module-azure-repositories","Backend","0.3.0","Community Support","./dynamic-plugins/dist/parfuemerie-douglas-scaffolder-backend-module-azure-repositories",";","Disabled"
3131
"Bitbucket Cloud ","@backstage/plugin-catalog-backend-module-bitbucket-cloud","Backend","0.2.9","Community Support","./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-bitbucket-cloud-dynamic","`BITBUCKET_WORKSPACE`;","Disabled"
3232
"Bitbucket Cloud ","@backstage/plugin-scaffolder-backend-module-bitbucket-cloud","Backend","0.1.12","Community Support","./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-bitbucket-cloud-dynamic",";","Disabled"
3333
"Bitbucket Server ","@backstage/plugin-catalog-backend-module-bitbucket-server","Backend","0.1.36","Community Support","./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-bitbucket-server-dynamic","`BITBUCKET_HOST`;","Disabled"

modules/dynamic-plugins/rhdh-supported-plugins.sh

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@ titlecase() {
8181
}
8282

8383
# generate a list of plugin:version mapping from the following files
84-
# * dynamic-plugins/imports/package.json#.peerDependencies or .dependencies
85-
# * packages/app/package.json#.dependencies
86-
# * packages/backend/package.json#.dependencies
87-
pluginVersFile=/tmp/plugin-versions.txt
88-
jq -r '.peerDependencies' /tmp/backstage-showcase/dynamic-plugins/imports/package.json | grep -E -v "\"\*\"|\{|\}" | grep "@" | tr -d "," > $pluginVersFile
89-
jq -r '.dependencies' /tmp/backstage-showcase/packages/{app,backend}/package.json | grep -E -v "\"\*\"|\{|\}" | grep "@" | tr -d "," >> $pluginVersFile
90-
cat $pluginVersFile | sort -uV > $pluginVersFile.out; mv -f $pluginVersFile.out $pluginVersFile
84+
# * dynamic-plugins/imports/package.json#.peerDependencies or .dependencies
85+
# * packages/app/package.json#.dependencies
86+
# * packages/backend/package.json#.dependencies
87+
pluginVersFile=/tmp/plugin-versions.txt
88+
jq -r '.peerDependencies' /tmp/backstage-showcase/dynamic-plugins/imports/package.json | grep -E -v "\"\*\"|\{|\}" | grep "@" | tr -d "," > $pluginVersFile
89+
jq -r '.dependencies' /tmp/backstage-showcase/packages/{app,backend}/package.json | grep -E -v "\"\*\"|\{|\}" | grep "@" | tr -d "," >> $pluginVersFile
90+
cat $pluginVersFile | sort -uV > $pluginVersFile.out; mv -f $pluginVersFile.out $pluginVersFile
91+
92+
rm -fr /tmp/warnings.txt
9193

9294
# create arrays of adoc and csv content
9395
declare -A adoc1
@@ -118,7 +120,9 @@ for j in $jsons; do
118120
# backstage-plugin-catalog-backend-module-bitbucket-cloud => @backstage/plugin-catalog-backend-module-bitbucket-cloud
119121
Plugin="${Name}"
120122
if [[ $Plugin != "@"* ]]; then # don't update janus-idp/backstage-plugins plugin names
121-
Plugin="$(echo "${Plugin}" | sed -r -e 's/([^-]+)-(.+)/\@\1\/\2/' -e 's|backstage/community-|backstage-community/|')"
123+
Plugin="$(echo "${Plugin}" | sed -r -e 's/([^-]+)-(.+)/\@\1\/\2/' \
124+
-e 's|backstage/community-|backstage-community/|' \
125+
-e 's|parfuemerie/douglas-|parfuemerie-douglas/|')"
122126
fi
123127

124128
# "dynamic-plugins/wrappers/backstage-plugin-catalog-backend-module-bitbucket-cloud" ==> ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-bitbucket-cloud-dynamic
@@ -153,22 +157,34 @@ for j in $jsons; do
153157
if [[ ! $Path ]]; then
154158
continue
155159
elif [[ $Path ]] || [[ "$j" == *"/wrappers/"* ]]; then
156-
157160
# RHIDP-3203 just use the .package value from /tmp/backstage-showcase/dynamic-plugins.default.yaml as the Path
158-
159-
160161
Role=$(jq -r '.backstage.role' "$j")
161-
162-
Version=$(jq -r '.version' "$j")
162+
VersionJQ=$(jq -r '.version' "$j")
163163
# check this version against other references to the plugin in
164164
# * dynamic-plugins/imports/package.json#.peerDependencies or .dependencies
165165
# * packages/app/package.json#.dependencies
166166
# * packages/backend/package.json#.dependencies
167-
echo "[DEBUG] Check version of $Name is really $Version ..."
167+
echo "[DEBUG] Check version of $Name is really $VersionJQ (from Path = $Path)..."
168168
match=$(grep "\"$Name\": \"" $pluginVersFile || true)
169+
Version=$VersionJQ
169170
if [[ $match ]]; then
170171
Version=$(echo "${match}" | sed -r -e "s/.+\": \"([0-9.]+)\"/\1/")
171-
echo "[DEBUG] Updated version = $Version"
172+
echo "[WARN] !! Using $pluginVersFile version = $Version, not $VersionJQ from $Path" | tee -a /tmp/warnings.txt
173+
fi
174+
175+
# check if there's a newer version at npmjs.com and warn if so
176+
# for tags and associated repo digests (git head)
177+
# curl -sSLko- https://registry.npmjs.org/@janus-idp%2fcli | jq -r '.versions[]|(.version+", "+.gitHead)' | sort -uV
178+
# for timestamp when tag is created
179+
# curl -sSLko- https://registry.npmjs.org/@janus-idp%2fcli | jq -r '.time' | grep -v -E "created|modified|{|}" | sort -uV
180+
allVersionsPublished="$(curl -sSLko- "https://registry.npmjs.org/${Plugin/\//%2f}" | jq -r '.versions[].version')"
181+
# echo $allVersionsPublished
182+
# clean out any pre-release versions
183+
latestXYRelease="$(echo "$allVersionsPublished" | grep -v -E -- "next|alpha|-" | grep -E "^${Version%.*}" | sort -uV | tail -1)"
184+
echo "[DEBUG] Latest x.y version at https://registry.npmjs.org/${Plugin/\//%2f} : $latestXYRelease"
185+
if [[ "$latestXYRelease" != "$Version" ]]; then
186+
echo "[WARN] !! Newer $latestXYRelease > $Version - should upgrade to https://www.npmjs.com/package/$Plugin/v/$latestXYRelease !!" | tee -a /tmp/warnings.txt
187+
echo | tee -a /tmp/warnings.txt
172188
fi
173189

174190
# default to community unless it's a RH-authored plugin
@@ -320,3 +336,8 @@ if [[ -f "${ENABLED_PLUGINS}.errors" ]]; then cat "${ENABLED_PLUGINS}.errors"; f
320336
# cleanup
321337
rm -f "$ENABLED_PLUGINS" "${ENABLED_PLUGINS}.errors"
322338
# rm -fr /tmp/backstage-plugins /tmp/backstage-showcase
339+
340+
warnings=$(grep -c "WARN" "/tmp/warnings.txt")
341+
if [[ $warnings -gt 0 ]]; then
342+
echo; echo "[WARN] $warnings warnings collected in /tmp/warnings.txt ! Consider upgrading upstream project to newer plugin versions !"
343+
fi

0 commit comments

Comments
 (0)