Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a8fc8c6
Merge pull request #214 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
7df280b
Merge pull request #219 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
5933e7d
Merge pull request #221 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
4d69e43
chore(cicd): automating pipeline progression of dependabot bumps
Phil-NHS Sep 1, 2025
bc4b547
Merge pull request #225 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
59b6a1f
chore(checks): fail due to artifact
Phil-NHS Sep 1, 2025
306ec36
chore(cicd): safer disabling of scripts
Phil-NHS Sep 1, 2025
db831a2
chore(automerge): gh docs
Phil-NHS Sep 1, 2025
a220ce0
Merge pull request #228 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
8db2b13
chore(dependabot): auto
Phil-NHS Sep 1, 2025
64ccf8c
Merge pull request #231 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
6aba224
Merge pull request #229 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
8167b1b
chore(dependabot): automated
Phil-NHS Sep 1, 2025
1bda87c
Merge pull request #233 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
b6f8099
Merge pull request #234 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
fdc368a
Merge pull request #232 from TechnologyEnhancedLearning/Automatic_ver…
Phil-NHS Sep 1, 2025
e962141
chore(dependabot): autom
Phil-NHS Sep 1, 2025
1ce7b80
Merge pull request #235 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
d744e96
chore(dependabot): naming caps
Phil-NHS Sep 1, 2025
f6c755a
Merge pull request #237 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
942f2ed
chore(dep): remove check for now
Phil-NHS Sep 1, 2025
462e148
Merge pull request #236 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
362bec9
Merge pull request #238 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
e319eb9
Merge pull request #239 from TechnologyEnhancedLearning/Automatic_ver…
Phil-NHS Sep 1, 2025
15aa4b3
chore(deps): token definition
Phil-NHS Sep 1, 2025
69acfe9
Merge pull request #241 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
acb65e5
chore(dep): merge check
Phil-NHS Sep 1, 2025
9e447b2
Merge pull request #242 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
a0b4087
chore(cicd): title catching
Phil-NHS Sep 1, 2025
b30b9f0
Merge pull request #243 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
940430d
chore(depend): title getting
Phil-NHS Sep 1, 2025
65cb2aa
Merge pull request #245 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
02114f0
chore(deps): refactor
Phil-NHS Sep 1, 2025
6639ec2
Merge pull request #246 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
098a925
chore(dependabot): automerge
Phil-NHS Sep 1, 2025
4f2e826
Merge pull request #248 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
f97d61b
chore(deps): drop debug
Phil-NHS Sep 1, 2025
2fb0e83
Merge pull request #249 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,38 +1,71 @@
# This script seperate major and minor but we do merge them into the same branch.
# Having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
name: Auto-merge Dependabot PRs into collected branch
# qqqq in development
# this script seperate major and minor but we do merge them into the same branch.
# having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
name: auto-merge dependabot prs into collected branch
on:
pull_request:
types: [opened, synchronize]
branches: [Automatic_version_update_dependabot] # Make sure this matches your actual branch name
branches: [Automatic_version_update_dependabot]


permissions:
contents: write
pull-requests: write
checks: read

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: debug info
run: |
echo "actor: ${{ github.actor }}"
echo "pr title: ${{ github.event.pull_request.title }}"
echo "github event_name: ${{ github.event_name }}"
echo "target branch: ${{ github.event.pull_request.base.ref }}"
echo "source branch: ${{ github.event.pull_request.head.ref }}"
echo "PR Number: ${{ github.event.pull_request.number }}"

# Branch rules ensure doesnt auto merge if shouldnt
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
# qqqq add in after testing if: github.actor == 'dependabot[bot]'
steps:
- name: Extract update type
- name: Checkout the repository
uses: actions/checkout@v4

- name: Set up GitHub CLI
run: |
# Install GitHub CLI (gh)
sudo apt-get update
sudo apt-get install gh

- name: extract update type
id: extract
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if [[ $PR_TITLE == *"(major)"* ]]; then
echo "get pr title"
pr_title="${{ github.event.pull_request.title }}"
echo "PR title: $pr_title"
if [[ "$pr_title" == *"(major)"* ]]; then
echo "update_type=major" >> $GITHUB_OUTPUT
echo "Detected major update"
else
echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
echo "Detected minor or patch update"
fi

- name: Auto-merge minor and patch updates
- name: auto-merge minor and patch updates
if: steps.extract.outputs.update_type == 'minor_or_patch'
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
run: |
gh pr merge --auto --merge "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge major updates
- name: auto-merge major updates
if: steps.extract.outputs.update_type == 'major'
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
run: |
gh pr merge --auto --merge "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# qqqq this does add auto merge but seems to trigger on the first set of checks git guardian (it seems),
# also it calls for checks not specifically for out branch
# so an approach based one the branch is likely better
name: auto-merge dependabot prs into collected branch
on:
# pull_request:
# synchronize
# types: [opened, synchronize]
# branches: [Automatic_version_update_dependabot] # make sure this matches your actual branch name
check_suite:
types: [completed]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
checks: read

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: debug info
run: |
echo "actor: ${{ github.actor }}"
echo "pr title: ${{ github.event.pull_request.title }}"
echo "github event_name: ${{ github.event_name }}"
echo "github event_suite conlusion: ${{ github.event.check_suite.conclusion }}"
echo "target branch: ${{ github.event.pull_request.base.ref }}"
echo "source branch: ${{ github.event.pull_request.head.ref }}"
echo "Check Suite ID: ${{ github.event.check_suite.id }}"
echo "Conclusion: ${{ github.event.check_suite.conclusion }}"
echo "Target Branch: ${{ github.event.check_suite.pull_requests[0].base.ref }}"
echo "PR Number: ${{ github.event.check_suite.pull_requests[0].number }}"

- name: Dump event payload
run: |
echo "==== EVENT NAME ===="
echo "${{ github.event_name }}"
echo "==== RAW CHECK_SUITE PAYLOAD ===="
echo '${{ toJson(github.event.check_suite) }}'
echo "==== PRs in this check suite ===="
echo '${{ toJson(github.event.check_suite.pull_requests) }}'


auto-merge:
runs-on: ubuntu-latest
# if: github.event.check_suite.pull_requests[0].base.ref == 'main'
# if dependabot and checks ran
# if: (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')
# qqqq put back in later if: (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')


# qqqq add in after testing && github.actor == 'dependabot[bot]'
if: github.event.check_suite.conclusion == 'success' && github.event.check_suite.pull_requests[0].base.ref == 'Automatic_version_update_dependabot'
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Set up GitHub CLI
run: |
# Install GitHub CLI (gh)
sudo apt-get update
sudo apt-get install gh

- name: extract update type
id: extract
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "get pr number"
pr_number=${{ github.event.check_suite.pull_requests[0].number }}
echo "PR title: $pr_number"
# pr_title="${{ github.event.pull_request.title }}"
pr_title=$(gh pr view "$pr_number" --json title --jq .title)
echo "PR title: $pr_title"
if [[ $pr_title == *"(major)"* ]]; then
echo "update_type=major" >> $GITHUB_OUTPUT
else
echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
fi

- name: auto-merge minor and patch updates
if: steps.extract.outputs.update_type == 'minor_or_patch'
# auto should set the the request to merge once checks complete
# qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
# run: gh pr merge --auto 1
run: gh pr merge --auto --merge ${{ github.event.check_suite.pull_requests[0].number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: auto-merge major updates
if: steps.extract.outputs.update_type == 'major'
# auto should set the the request to merge once checks complete
# qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
# run: gh pr merge --auto 1
run: gh pr merge --auto --merge ${{ github.event.check_suite.pull_requests[0].number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# qqqq in development
name: Collected Dependabot Promotion From Staging To Master
on:
schedule:
Expand All @@ -22,7 +23,7 @@ jobs:
id: changes
run: |
git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging
git fetch origin master:master # or main/master - whatever your prod branch is
git fetch origin master:master

if git diff --quiet master Automatic_collected_dependabot_staging; then
echo "has_changes=false" >> $GITHUB_OUTPUT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# qqqq in development

name: Dependabot Collected Promotion To Staging
# this logic will require branch ruleset checks of running the dev pipeline
on:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/reuseable-ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ jobs:
# Echo the entire artifact list for debugging purposes
echo "Artifact List: $ARTIFACT_LIST"

ARTIFACT_URL=$(echo "$ARTIFACT_LIST" | jq -r '.artifacts[] | select(.name=="coverage-report") | .url')
#qqqq worked mostly ARTIFACT_URL=$(echo "$ARTIFACT_LIST" | jq -r '.artifacts[] | select(.name=="coverage-report") | .url')
ARTIFACT_URL=$(echo "$ARTIFACT_LIST" | jq -r '.artifacts | map(select(.name=="coverage-report")) | sort_by(.created_at) | last | .url')


# Echo the artifact URL to confirm
echo "Artifact URL: $ARTIFACT_URL"
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/workflow-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,43 @@ The individual steps also automatically pass so can see if any error at the end
- autoverging is being tried for major and minor
- branch checks must pass for merge on automated_version
- checks required but overrideable for all workflows
- dependabot secret names to match repos ones where need to share
- dependabot not need to build package later brnch does

## Dependabot Pipeline (AI generatated diag)

```mermaid
flowchart TD
%% Dependabot PR to initial branch
A[Dependabot PR] --> B[Automatic_version_update_dependabot]

%% Checks on the dependabot branch
B --> C[Run Checks]
C --> C1[Commit name check ❌ skipped]
C --> C2[Branch name check ❌ skipped]
C --> C3[Build as release]
C --> C4[Unit tests]
C --> C5[E2E tests]

%% Weekly merge to staging
B -->|Weekly merge via collected-dependabot-to-staging.yml| D[Automatic_collected_dependabot_staging]

%% Staging checks and dev build
D --> E[Run Checks & Dev Build]
E --> E1[Checks again]
E --> E2[Build dev package]
E --> E3[Showcase dev page]

%% Weekly merge to master
D -->|Weekly merge via collected-dependabot-staging-to-master.yml| F[Master]
```

## Versioning
Via semantic release and recorded as a generate c# file used by a blazor component

## Alternative Approaches

```

name: Pull Request Checks

# ⚠️ pull_request_target is dangerous it allows secrets to be used by forks and bots, ⚠️
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,4 @@ TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/Logs/*
# Generated version info files
TELBlazor.Components/TELBlazorPackageVersion/VersionInfo*.cs
/.github/workflows/test.yml
/Optimisation Notes.md
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ the ability to produce static prerendered html. The prerendered html is written
- **Node.js 18+** and npm
- **Git** configured with your credentials
- **PowerShell 5.1+**
- **Longfile names enabled on the system**
> ⚠️ **Important:** All commands in this guide require **PowerShell running as Administrator**

### Quick Setup ⚡
Expand Down Expand Up @@ -116,6 +117,10 @@ The project should now work. See other sections for what projects to run, and co

> ⚠️ read the contribution section before creating a branch or commits ⚠️

### Trouble Shooting
- Longpaths may be required if E2E Client is not building.
- Follow [microsoft docs](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry)
- or Win + R -> type regedit -> path to the option HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem -> set LongPathsEnabled to 1

### Getting Started with the Project following Setup

Expand Down
Loading