From 27a2d68e9bab4e18c5203c5ebfe2db35cd33d09e Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Wed, 10 Sep 2025 19:10:13 +0530 Subject: [PATCH] Enhance GitHub workflows and templates - Updated dependabot configuration to include Maven, GitHub Actions, and npm with weekly update schedules and limits on open pull requests. - Added a pull request template to standardize contributions and ensure necessary information is provided. - Introduced issue templates for bug reports and feature requests to streamline issue tracking and enhance user experience. - Created workflows for CodeQL analysis, pre-commit checks, and stale issue management to improve code quality and maintainability. --- .github/ISSUE_TEMPLATE/bug_report.yml | 59 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 6 +++ .github/ISSUE_TEMPLATE/feature_request.yml | 31 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 34 +++++++++++++ .github/dependabot.yml | 33 ++++++++++-- .github/workflows/codeql.yml | 44 ++++++++++++++++ .github/workflows/pre-commit.yml | 30 +++++++++++ .github/workflows/stale.yml | 33 ++++++++++++ 8 files changed, 265 insertions(+), 5 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..35f84f0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,59 @@ +name: Bug report +description: File a bug report +labels: [bug] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: version + attributes: + label: ollama4j version + description: e.g., 1.1.0 + placeholder: 1.1.0 + validations: + required: true + - type: input + id: java + attributes: + label: Java version + description: Output of `java -version` + placeholder: 11/17/21 + validations: + required: true + - type: input + id: environment + attributes: + label: Environment + description: OS, build tool, Docker/Testcontainers, etc. + placeholder: macOS 13, Maven 3.9.x, Docker 24.x + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us what you expected to happen + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Be as specific as possible + placeholder: | + 1. Setup ... + 2. Run ... + 3. Observe ... + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant logs/stack traces + render: shell + - type: textarea + id: additional + attributes: + label: Additional context + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..fdf6f43 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +blank_issues_enabled: false +contact_links: + - name: Questions / Discussions + url: https://github.com/ollama4j/ollama4j/discussions + about: Ask questions and discuss ideas here + diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..ab5e08a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,31 @@ +name: Feature request +description: Suggest an idea or enhancement +labels: [enhancement] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for suggesting an improvement! + - type: textarea + id: problem + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of the problem + placeholder: I'm frustrated when... + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + placeholder: I'd like... + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + - type: textarea + id: context + attributes: + label: Additional context + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..06e6892 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ +## Description + +Describe what this PR does and why. + +## Type of change + +- [ ] feat: New feature +- [ ] fix: Bug fix +- [ ] docs: Documentation update +- [ ] refactor: Refactoring +- [ ] test: Tests only +- [ ] build/ci: Build or CI changes + +## How has this been tested? + +Explain the testing done. Include commands, screenshots, logs. + +## Checklist + +- [ ] I ran `pre-commit run -a` locally +- [ ] `make build` succeeds locally +- [ ] Unit/integration tests added or updated as needed +- [ ] Docs updated (README/docs site) if user-facing changes +- [ ] PR title follows Conventional Commits + +## Breaking changes + +List any breaking changes and migration notes. + +## Related issues + +Fixes # + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5990d9c..d683b02 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,34 @@ # To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +## package ecosystems to update and where the package manifests are located. +## Please see the documentation for all configuration options: +## https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +# +#version: 2 +#updates: +# - package-ecosystem: "" # See documentation for possible values +# directory: "/" # Location of package manifests +# schedule: +# interval: "weekly" + version: 2 updates: - - package-ecosystem: "" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "maven" + directory: "/" schedule: interval: "weekly" + open-pull-requests-limit: 5 + labels: ["dependencies"] + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: ["dependencies"] + - package-ecosystem: "npm" + directory: "/docs" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: ["dependencies"] +# diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..127f95b --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,44 @@ +name: CodeQL + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '0 3 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [ 'java', 'javascript' ] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK + if: matrix.language == 'java' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '11' + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..296e46c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,30 @@ +name: Pre-commit Check on PR + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - main + +#on: +# pull_request: +# branches: [ main ] +# push: +# branches: [ main ] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install pre-commit + run: | + python -m pip install --upgrade pip + pip install pre-commit + - name: Run pre-commit + run: | + pre-commit run --all-files --show-diff-on-failure + diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..ec1c66b --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,33 @@ +name: Mark stale issues and PRs + +on: + schedule: + - cron: '0 2 * * *' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + days-before-stale: 60 + days-before-close: 14 + stale-issue-label: 'stale' + stale-pr-label: 'stale' + exempt-issue-labels: 'pinned,security' + exempt-pr-labels: 'pinned,security' + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + close-issue-message: > + Closing this stale issue. Feel free to reopen if this is still relevant. + stale-pr-message: > + This pull request has been automatically marked as stale due to inactivity. + It will be closed if no further activity occurs. + close-pr-message: > + Closing this stale pull request. Please reopen when you're ready to continue. +