From 8140e8ae3c23355f59380e55dd6e0626d30a7cf9 Mon Sep 17 00:00:00 2001 From: Phil-NHS Date: Tue, 27 May 2025 12:55:36 +0100 Subject: [PATCH 1/4] feat(tweaks): lint limit --- .commitlintrc.json | 3 ++- .gitignore | 2 ++ CICDPackageLocation/gitinclude.txt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 CICDPackageLocation/gitinclude.txt diff --git a/.commitlintrc.json b/.commitlintrc.json index e7973da..dc13638 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -25,6 +25,7 @@ "security", "config" ] - ] + ], + "header-max-length": [ 2, "always", 100 ] } } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8de47f2..0c5d32c 100644 --- a/.gitignore +++ b/.gitignore @@ -194,4 +194,6 @@ CHANGELOG.md /TELBlazor.Components/wwwroot/css/nhsuk.css /TELBlazor.Components.ShowCase.Shared/wwwroot/css/nhsuk.css /TELBlazor.Components.ShowCase.E2ETests/Reports/*.zip +/CICDPackageLocation/*.nupkg + diff --git a/CICDPackageLocation/gitinclude.txt b/CICDPackageLocation/gitinclude.txt new file mode 100644 index 0000000..36b953d --- /dev/null +++ b/CICDPackageLocation/gitinclude.txt @@ -0,0 +1 @@ +gitinclude \ No newline at end of file From 406af875c83c30ddadc4fe94bb12209c50d4ae96 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 27 May 2025 12:04:40 +0000 Subject: [PATCH 2/4] chore(release): 1.4.0-feat-button-for-cicd-testing.1 [skip ci] # [1.4.0-feat-button-for-cicd-testing.1](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.3.0...v1.4.0-feat-button-for-cicd-testing.1) (2025-05-27) ### Features * **tweaks:** lint limit ([8140e8a](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/8140e8ae3c23355f59380e55dd6e0626d30a7cf9)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b920e20..051badf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.4.0-feat-button-for-cicd-testing.1](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.3.0...v1.4.0-feat-button-for-cicd-testing.1) (2025-05-27) + + +### Features + +* **tweaks:** lint limit ([8140e8a](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/8140e8ae3c23355f59380e55dd6e0626d30a7cf9)) + # [1.3.0](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.2.0...v1.3.0) (2025-05-27) From e5832d2304a7e5a03f832769ff891cf173915f3f Mon Sep 17 00:00:00 2001 From: Phil-NHS Date: Tue, 27 May 2025 13:48:37 +0100 Subject: [PATCH 3/4] feat(button): dispatch for pr --- .github/workflows/pull_request.yml | 6 + .github/workflows/workflow-readme.md | 6 +- README.md | 180 ++++++++++++++++----------- 3 files changed, 121 insertions(+), 71 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 40ffc8a..c48246e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -3,8 +3,14 @@ name: Pull Request Checks on: pull_request: branches: ['**'] # Run on all branches + workflow_dispatch: jobs: + dummy: + runs-on: ubuntu-latest + steps: + - name: Dummy Step + run: echo "This is a dummy job to allow workflow_dispatch" pull-request-call-reusable-ci-checks-workflow: name: Pull Request run CI Checks uses: ./.github/workflows/reuseable-ci-checks.yml diff --git a/.github/workflows/workflow-readme.md b/.github/workflows/workflow-readme.md index 84cdfa4..c88028b 100644 --- a/.github/workflows/workflow-readme.md +++ b/.github/workflows/workflow-readme.md @@ -37,10 +37,14 @@ they stay in the pull request ui. they are also only targetted on master - npm and node - seperate script to auto merge +## automerge-passing-minor-patch-dependabot-prs +- + # Git setup ## Pull requests -- Branch checks for master (they dont directly use Reuseable Ci Checks instead they use them via the pull_request yml, unsure why not directly available) +- Branch checks for master dont work, they don't run the workflow dispatch. +If we want these checks one solution is every check in its own yml (they dont directly use Reuseable Ci Checks instead they use them via the pull_request yml) # Notes diff --git a/README.md b/README.md index 47ce3ef..53ed442 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ - # TELBlazor TEL Blazor Component Library Package +# This ReadMe + +This readme is the repo readme, it is also used as the package readme as this is the solution for making the TELBlazor.Components package. +There is also a cicd readme in the workflow folder. + +The [MVCBlazor repo ](https://github.com/TechnologyEnhancedLearning/MVCBlazor) readme has exploration of various of the choices and alternatives to what is implemented here. And the other blazor repos may +also be a useful resource when developing for this repo. + # Purpose Progressive components, that use the server prerendering in Global Wasm Blazor to ensure that if the user has no JS they will get html. And that html can be created to have working post actions. The render cycle will hydrate the prerender and the post actions will be overrided by services injected in the components. It is client side so the users browser will do the work. + # Links @@ -34,80 +42,112 @@ It is client side so the users browser will do the work. # Set Up -## How to set up this solution locally -*Be aware wasm wwwroot appsettings are public* -- TELBlazor\TELBlazor.Components.ShowCase.E2ETests\bin\Debug\net8.0\playwright.ps1 need to be run as admin -- local hook for commits, recommended for pre commit, and pre push as can only check the commit name value post commit +## "It works on my machine" +qqqq run release first make branch for kevin +### Hi Kevin, Please rewrite or correct these steps. +- im expecting ome global node may end up not working if anything as its already set up on my machine + +### Steps + +#### Get the repo +1. Go to [TELBlazor Repo](https://github.com/TechnologyEnhancedLearning/TELBlazor) hit code and get the clone string +1. Clone the repo locally +1. Go to [TELBlazor Repo](https://github.com/TechnologyEnhancedLearning/TELBlazor) + - create a branch (**there is branch name checks in cicd**) so for example call it "docs-readme-setup-instructions" + - [branch lint rule](https://github.com/TechnologyEnhancedLearning/TELBlazor/blob/master/.releaserc.json) + - you commits will look like this "docs(readme): added detail on commit rules" +1. Fetch, and checkout your new branch locally so you can add to the readme as you go + - create commit "docs(readme): first commit" + - see [commit rules](https://github.com/TechnologyEnhancedLearning/TELBlazor/blob/master/.commitlintrc.json) + - *these rules also enable the versioning in cicd* + - Bonus dont wait for the pipeline to fail your commit names and expose your secrets: you may want to add + - gitguardian from confluence docs (follow it to the letter) [gitguardian global setup instructions](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3855253505/GitGuardian+Setup+-+Simplified+Version) + - and add a pre-commit and push hook (you need both as you cannot lint what hasnt yet been commit) you add these to your templates if you want them for every repo, or just to this repo, or you can be lazy and add them into the gitguardian hook + - ``` + #### --- Commitlint Logic (force local config) --- + REPO_ROOT=$(git rev-parse --show-toplevel) + CONFIG_PATH="$REPO_ROOT/.commitlintrc.json" + echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind" + echo "so would work best in prepush template" + COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG" + + # Check if the local .commitlintrc.json exists in the repository root + if [ -f "$CONFIG_PATH" ]; then + + echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..." + echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️" + + if command -v npx &> /dev/null; then + + cd "$REPO_ROOT" || exit 1 + + # Debug: Print the commit message file content + if [ -f "$COMMIT_MSG_FILE" ]; then + echo "Commit message content:" + cat "$COMMIT_MSG_FILE" + else + echo "❌ Commit message file not found!" + exit 1 + fi + + + # Run commitlint, explicitly pointing to the local config and providing the commit message via stdin + OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1) + + EXIT_CODE1=$? + # echo "!!!!!!!!!!! OUTPUT1" + # echo "$OUTPUT1" + + + # OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1) + + # EXIT_CODE2=$? + # echo "!!!!!!!!!!! OUTPUT2" + # echo "$OUTPUT2" + + # OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1) + + + # EXIT_CODE3=$? + # echo "!!!!!!!!!!! OUTPUT3" + # echo "$OUTPUT3" + + + + #if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then + if [ "$EXIT_CODE1" -ne 0 ]; then + echo "❌ Commitlint failed:" + + echo "$OUTPUT1" + exit 1 + else + echo "✅ Commitlint passed!" + fi + else + echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint." + # Optionally fail here + # exit 1 + fi + else + echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint." + fi + ``` +### Install packages -``` - # --- Commitlint Logic (force local config) --- - REPO_ROOT=$(git rev-parse --show-toplevel) - CONFIG_PATH="$REPO_ROOT/.commitlintrc.json" - echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind" - echo "so would work best in prepush template" - COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG" +### Create local files - # Check if the local .commitlintrc.json exists in the repository root - if [ -f "$CONFIG_PATH" ]; then +### Set local environment variables - echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..." - echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️" +### Run tests + + + +### How to set up this solution locally +*Be aware wasm wwwroot appsettings are public* +- TELBlazor\TELBlazor.Components.ShowCase.E2ETests\bin\Debug\net8.0\playwright.ps1 need to be run as admin +- local hook for commits, recommended for pre commit, and pre push as can only check the commit name value post commit - if command -v npx &> /dev/null; then - - cd "$REPO_ROOT" || exit 1 - # Debug: Print the commit message file content - if [ -f "$COMMIT_MSG_FILE" ]; then - echo "Commit message content:" - cat "$COMMIT_MSG_FILE" - else - echo "❌ Commit message file not found!" - exit 1 - fi - - - # Run commitlint, explicitly pointing to the local config and providing the commit message via stdin - OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1) - - EXIT_CODE1=$? - # echo "!!!!!!!!!!! OUTPUT1" - # echo "$OUTPUT1" - - - # OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1) - - # EXIT_CODE2=$? - # echo "!!!!!!!!!!! OUTPUT2" - # echo "$OUTPUT2" - - # OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1) - - - # EXIT_CODE3=$? - # echo "!!!!!!!!!!! OUTPUT3" - # echo "$OUTPUT3" - - - - #if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then - if [ "$EXIT_CODE1" -ne 0 ]; then - echo "❌ Commitlint failed:" - - echo "$OUTPUT1" - exit 1 - else - echo "✅ Commitlint passed!" - fi - else - echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint." - # Optionally fail here - # exit 1 - fi - else - echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint." - fi -``` - open powershell admin - go to e2e project bin/Debug/net8 - run the playwright script with "install" From 6030fbe3aa5c367b53ba6e3c0b41fac8af032aaf Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 27 May 2025 12:52:33 +0000 Subject: [PATCH 4/4] chore(release): 1.4.0-feat-button-for-cicd-testing.2 [skip ci] # [1.4.0-feat-button-for-cicd-testing.2](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.4.0-feat-button-for-cicd-testing.1...v1.4.0-feat-button-for-cicd-testing.2) (2025-05-27) ### Features * **button:** dispatch for pr ([e5832d2](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/e5832d2304a7e5a03f832769ff891cf173915f3f)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 051badf..62996e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.4.0-feat-button-for-cicd-testing.2](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.4.0-feat-button-for-cicd-testing.1...v1.4.0-feat-button-for-cicd-testing.2) (2025-05-27) + + +### Features + +* **button:** dispatch for pr ([e5832d2](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/e5832d2304a7e5a03f832769ff891cf173915f3f)) + # [1.4.0-feat-button-for-cicd-testing.1](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.3.0...v1.4.0-feat-button-for-cicd-testing.1) (2025-05-27)