-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add AI chatbot feature with configuration, access control, and attachment management #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
912d55d
feat: add AI chatbot feature with configuration, access control, and …
JoachimLK 4785db5
feat: enhance workflows and documentation for release process, includ…
JoachimLK f11a78f
feat: implement unique default chatbot agent constraint and enhance r…
JoachimLK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: PR Title Lint | ||
|
|
||
| # Enforce Conventional Commit syntax in PR titles so release-please can | ||
| # always derive a clean changelog and the correct semver bump from the | ||
| # squash-merged commit. Without this, a single mis-titled PR silently | ||
| # disappears from the release notes. | ||
| # | ||
| # Examples that pass: | ||
| # feat: add candidate bulk import | ||
| # fix(jobs): handle null salary range | ||
| # chore(deps): bump nuxt from 4.3.1 to 4.3.2 | ||
| # | ||
| # Examples that fail: | ||
| # Update stuff | ||
| # WIP | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Validate PR title | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@v6 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| # Keep types aligned with .github/release-please-config.json | ||
| types: | | ||
| feat | ||
| fix | ||
| perf | ||
| security | ||
| docs | ||
| refactor | ||
| test | ||
| build | ||
| ci | ||
| chore | ||
| requireScope: false | ||
| subjectPattern: ^[A-Za-z0-9].+$ | ||
| subjectPatternError: | | ||
| The PR title subject must start with a letter or number and not | ||
| be empty. Example: `feat(jobs): add bulk import`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| name: Release Verification | ||
|
|
||
| # Fires after release-please publishes a GitHub Release (which also pushes a | ||
| # `v*` tag and triggers docker-publish.yml). This workflow is the last gate | ||
| # in the chain and provides two guarantees: | ||
| # | ||
| # 1. smoke-test: the *published* image (not a locally-built one) actually | ||
| # starts cleanly using the same setup.sh + docker-compose flow that | ||
| # self-hosters follow. If this fails, the release is auto-marked as a | ||
| # pre-release so it stops being advertised as the "Latest" release. | ||
| # | ||
| # 2. bundle: attach a self-hoster bundle (docker-compose.production.yml | ||
| # with the image tag pinned + setup.sh) to the GitHub Release so users | ||
| # can `curl -L .../releases/download/v1.4.0/reqcore-1.4.0.tar.gz` and | ||
| # get a deterministic, version-locked install. | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Release tag to verify (e.g. v1.4.0)" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: release-verification-${{ github.event.release.tag_name || inputs.tag }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| name: Smoke-test published image | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 35 | ||
| steps: | ||
| - name: Resolve release tag | ||
| id: tag | ||
| run: | | ||
| set -euo pipefail | ||
| tag="${{ github.event.release.tag_name || inputs.tag }}" | ||
| version="${tag#v}" | ||
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Checkout release tag | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ steps.tag.outputs.tag }} | ||
|
|
||
| - name: Pin compose file to the released image tag | ||
| run: | | ||
| set -euo pipefail | ||
| sed -i \ | ||
| "s|ghcr.io/reqcore-inc/reqcore:latest|ghcr.io/reqcore-inc/reqcore:${{ steps.tag.outputs.version }}|" \ | ||
| docker-compose.production.yml | ||
| grep "ghcr.io/reqcore-inc/reqcore" docker-compose.production.yml | ||
|
|
||
| - name: Wait for the published image to be available on GHCR | ||
| run: | | ||
| set -euo pipefail | ||
| # docker-publish.yml is triggered by the same tag push, so it may | ||
| # still be running when this job starts. Poll for up to 20 minutes. | ||
| for i in $(seq 60); do | ||
| if docker manifest inspect "ghcr.io/reqcore-inc/reqcore:${{ steps.tag.outputs.version }}" > /dev/null 2>&1; then | ||
| echo "✅ Image is available" | ||
| exit 0 | ||
| fi | ||
| echo " attempt $i/60 — image not yet published, waiting 20s..." | ||
| sleep 20 | ||
| done | ||
| echo "❌ Image ghcr.io/reqcore-inc/reqcore:${{ steps.tag.outputs.version }} never appeared" | ||
| exit 1 | ||
|
|
||
| - name: Generate .env via setup.sh | ||
| run: | | ||
| chmod +x ./setup.sh | ||
| ./setup.sh | ||
|
|
||
| - name: Start full stack against the published image | ||
| run: docker compose -f docker-compose.production.yml up -d | ||
|
|
||
| - name: Wait for app to be reachable | ||
| run: | | ||
| set -euo pipefail | ||
| for i in $(seq 60); do | ||
| if curl -fs http://localhost:3000 > /dev/null 2>&1; then | ||
| echo "✅ App reachable" | ||
| exit 0 | ||
| fi | ||
| sleep 3 | ||
| done | ||
| echo "❌ App did not become reachable" | ||
| docker compose -f docker-compose.production.yml logs app --tail=200 | ||
| exit 1 | ||
|
|
||
| - name: Assert migrations + S3 bucket ready | ||
| run: | | ||
| set -euo pipefail | ||
| # Startup messages can land slightly after the HTTP port opens, so | ||
| # poll instead of one-shot grepping to avoid flaky failures. | ||
| for i in $(seq 40); do | ||
| logs="$(docker compose -f docker-compose.production.yml logs app || true)" | ||
| if grep -q "Database migrations applied successfully" <<<"$logs" \ | ||
| && grep -q 'S3 bucket "reqcore" is ready' <<<"$logs"; then | ||
| echo "✅ Migrations + S3 ready messages found (attempt $i)" | ||
| exit 0 | ||
| fi | ||
| sleep 3 | ||
| done | ||
| echo "❌ Required startup messages missing after polling" | ||
| docker compose -f docker-compose.production.yml logs app | ||
| exit 1 | ||
|
|
||
| - name: Demote release to pre-release on failure | ||
| if: failure() && github.event_name == 'release' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh release edit "${{ steps.tag.outputs.tag }}" --prerelease --latest=false | ||
| gh release view "${{ steps.tag.outputs.tag }}" --json isPrerelease,isLatest | ||
|
|
||
| bundle: | ||
| name: Attach self-hoster bundle | ||
| needs: smoke-test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Resolve release tag | ||
| id: tag | ||
| run: | | ||
| set -euo pipefail | ||
| tag="${{ github.event.release.tag_name || inputs.tag }}" | ||
| version="${tag#v}" | ||
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Checkout release tag | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ steps.tag.outputs.tag }} | ||
|
|
||
| - name: Build version-pinned bundle | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p "bundle/reqcore-${{ steps.tag.outputs.version }}" | ||
| cp setup.sh "bundle/reqcore-${{ steps.tag.outputs.version }}/" | ||
| cp SELF-HOSTING.md "bundle/reqcore-${{ steps.tag.outputs.version }}/" | ||
| # Pin the compose file to the exact released image tag so users | ||
| # who download the bundle get a deterministic install. | ||
| sed \ | ||
| "s|ghcr.io/reqcore-inc/reqcore:latest|ghcr.io/reqcore-inc/reqcore:${{ steps.tag.outputs.version }}|" \ | ||
| docker-compose.production.yml \ | ||
| > "bundle/reqcore-${{ steps.tag.outputs.version }}/docker-compose.production.yml" | ||
|
|
||
| cat > "bundle/reqcore-${{ steps.tag.outputs.version }}/INSTALL.txt" <<EOF | ||
| Reqcore ${{ steps.tag.outputs.tag }} — Self-Hoster Bundle | ||
|
|
||
| 1. ./setup.sh | ||
| 2. docker compose -f docker-compose.production.yml up -d | ||
| 3. Open http://localhost:3000 | ||
|
|
||
| The image tag in docker-compose.production.yml is pinned to | ||
| ${{ steps.tag.outputs.version }}. To upgrade later, download the | ||
| newer release bundle and re-run docker compose up -d. | ||
|
|
||
| Full guide: SELF-HOSTING.md | ||
| EOF | ||
|
|
||
| tar -czf "reqcore-${{ steps.tag.outputs.version }}.tar.gz" -C bundle "reqcore-${{ steps.tag.outputs.version }}" | ||
| sha256sum "reqcore-${{ steps.tag.outputs.version }}.tar.gz" > "reqcore-${{ steps.tag.outputs.version }}.tar.gz.sha256" | ||
|
|
||
| - name: Attach bundle to the GitHub Release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh release upload "${{ steps.tag.outputs.tag }}" \ | ||
| "reqcore-${{ steps.tag.outputs.version }}.tar.gz" \ | ||
| "reqcore-${{ steps.tag.outputs.version }}.tar.gz.sha256" \ | ||
| --clobber |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| // VS Code tasks for the release / dependency workflow. | ||
| // | ||
| // Run any of these via: Ctrl+Shift+P → "Tasks: Run Task" | ||
| // | ||
| // The whole release flow is automated by GitHub Actions (release-please + | ||
| // docker-publish + release-smoke-test). These tasks are only for visibility | ||
| // and one-off local actions — you should never *need* them in steady state. | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Release: watch latest run", | ||
| "type": "shell", | ||
| "command": "gh run list --workflow=release-please.yml --limit 5 && gh run watch", | ||
| "problemMatcher": [], | ||
| "presentation": { "reveal": "always", "panel": "dedicated" }, | ||
| "detail": "Show recent release-please runs and tail the latest." | ||
| }, | ||
| { | ||
| "label": "Release: open release-please PR", | ||
| "type": "shell", | ||
| "command": "gh pr list --label autorelease:pending --json url --jq '.[0].url' | ForEach-Object { Start-Process $_ }", | ||
| "windows": { | ||
| "command": "gh pr list --label \"autorelease: pending\" --json url --jq '.[0].url' | ForEach-Object { Start-Process $_ }" | ||
| }, | ||
| "problemMatcher": [], | ||
| "detail": "Open the pending release-please PR in the browser." | ||
| }, | ||
| { | ||
| "label": "Release: dry-run notes (local)", | ||
| "type": "shell", | ||
| "command": "npx release-please release-pr --dry-run --token=$env:GITHUB_TOKEN --repo-url=https://github.com/reqcore-inc/reqcore --config-file=.github/release-please-config.json --manifest-file=.release-please-manifest.json", | ||
| "problemMatcher": [], | ||
| "detail": "Preview what the next release would contain, without creating anything." | ||
| }, | ||
| { | ||
| "label": "Dependabot: list open PRs", | ||
| "type": "shell", | ||
| "command": "gh pr list --author 'app/dependabot' --state open", | ||
| "problemMatcher": [], | ||
| "detail": "Show all open Dependabot PRs and their auto-merge status." | ||
| }, | ||
| { | ||
| "label": "Dependabot: enable automerge on current branch PR", | ||
| "type": "shell", | ||
| "command": "gh pr merge --auto --squash", | ||
| "problemMatcher": [], | ||
| "detail": "Enable auto-merge for the PR associated with the current branch (gates on CI)." | ||
| }, | ||
| { | ||
| "label": "CI: tail latest workflow run", | ||
| "type": "shell", | ||
| "command": "gh run watch", | ||
| "problemMatcher": [], | ||
| "presentation": { "reveal": "always", "panel": "dedicated" }, | ||
| "detail": "Tail the most recently triggered workflow run for this repo." | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.