chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
name: "\U0001F41B Bug report"
|
||||
description: "Report a bug in PentAGI"
|
||||
title: "[Bug]: "
|
||||
labels: ["bug"]
|
||||
assignees:
|
||||
- asdek
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report! Please provide as much information as possible to help us diagnose and fix the issue.
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Affected Component
|
||||
description: Which component of PentAGI is affected by this bug?
|
||||
multiple: true
|
||||
options:
|
||||
- Core Services (Frontend UI/Backend API)
|
||||
- AI Agents (Researcher/Developer/...)
|
||||
- Security Tools Integration
|
||||
- Memory System (Vector Store/Knowledge Base)
|
||||
- Monitoring Stack Integration (Grafana/OpenTelemetry)
|
||||
- Analytics Platform Integration (Langfuse)
|
||||
- External Integrations (LLM/Search APIs)
|
||||
- Documentation and User Experience
|
||||
- Other (please specify in the description)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: Please provide a clear and concise description of the bug, including expected and actual behavior.
|
||||
placeholder: |
|
||||
What happened:
|
||||
- Actual behavior: When executing a penetration test against [target], the AI agent [behavior]
|
||||
|
||||
What should happen:
|
||||
- Expected behavior: The system should [expected outcome]
|
||||
|
||||
Additional context:
|
||||
- Task/Flow ID (if applicable): [ID from UI]
|
||||
- Error messages: [any error messages from logs/UI]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: Please provide detailed steps to reproduce the bug.
|
||||
placeholder: |
|
||||
1. Access PentAGI Web UI at [relative URL]
|
||||
2. Start a new flow with parameters [...] or prompt [...]
|
||||
3. Configure target system as [...]
|
||||
4. Observe AI agent behavior in [...] or log from Langfuse
|
||||
5. Error occurs when [...] or screenshot/export logs from Grafana
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: System Configuration
|
||||
description: Please provide details about your setup
|
||||
placeholder: |
|
||||
PentAGI Version: [e.g., latest from Docker Hub]
|
||||
Deployment Type:
|
||||
- [ ] Docker Compose
|
||||
- [ ] Custom Deployment
|
||||
|
||||
Environment:
|
||||
- Docker Version: [output of `docker --version`]
|
||||
- Docker Compose Version: [output of `docker compose version`]
|
||||
- Host OS: [e.g., Ubuntu 22.04, macOS 14.0]
|
||||
- Available Resources:
|
||||
- RAM: [e.g., 8GB]
|
||||
- CPU: [e.g., 4 cores]
|
||||
- Disk Space: [e.g., 50GB free]
|
||||
|
||||
Enabled Features:
|
||||
- [ ] Langfuse Analytics
|
||||
- [ ] Grafana Monitoring
|
||||
- [ ] Custom LLM Server
|
||||
|
||||
Active Integrations:
|
||||
- LLM Provider: [OpenAI/Anthropic/Custom]
|
||||
- Search Systems: [Google/DuckDuckGo/Tavily/Traversaal/Perplexity]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Logs and Artifacts
|
||||
description: |
|
||||
Please provide relevant logs and artifacts. You can find logs using:
|
||||
- Docker logs: `docker logs pentagi`
|
||||
- Grafana dashboards (if enabled)
|
||||
- Langfuse traces (if enabled)
|
||||
- Browser console logs (for UI issues)
|
||||
placeholder: |
|
||||
```
|
||||
Paste logs here
|
||||
```
|
||||
|
||||
For large logs, please use GitHub Gist and provide the link.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshots or Recordings
|
||||
description: |
|
||||
If applicable, add screenshots or recordings to help explain your problem.
|
||||
- For UI issues: Browser screenshots/recordings
|
||||
- For agent behavior: Langfuse trace screenshots
|
||||
- For monitoring: Grafana dashboard screenshots
|
||||
placeholder: Drag and drop images/videos here, or paste links to external storage.
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
id: verification
|
||||
attributes:
|
||||
label: Verification
|
||||
description: Please verify the following before submitting
|
||||
options:
|
||||
- label: I have checked that this issue hasn't been already reported
|
||||
- label: I have provided all relevant configuration files (with sensitive data removed)
|
||||
- label: I have included relevant logs and error messages
|
||||
- label: I am running the latest version of PentAGI
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,115 @@
|
||||
name: "\U0001F680 Enhancement"
|
||||
description: "Suggest an enhancement for PentAGI"
|
||||
title: "[Enhancement]: "
|
||||
labels: ["enhancement"]
|
||||
assignees:
|
||||
- asdek
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for suggesting an enhancement to make PentAGI better! Please provide as much detail as possible to help us understand your suggestion.
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: Target Component
|
||||
description: Which component of PentAGI would this enhancement affect?
|
||||
multiple: true
|
||||
options:
|
||||
- Core Services (Frontend UI/Backend API)
|
||||
- AI Agents (Researcher/Developer/Executor)
|
||||
- Security Tools Integration
|
||||
- Memory System (Vector Store/Knowledge Base)
|
||||
- Monitoring Stack (Grafana/OpenTelemetry)
|
||||
- Analytics Platform (Langfuse)
|
||||
- External Integrations (LLM/Search APIs)
|
||||
- Documentation and User Experience
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Enhancement Description
|
||||
description: Please describe the enhancement you would like to see.
|
||||
placeholder: |
|
||||
Problem Statement:
|
||||
- Current Limitation: [describe what's currently missing or could be improved]
|
||||
- Use Case: [describe how you use PentAGI and why this enhancement would help]
|
||||
|
||||
Proposed Solution:
|
||||
- Feature Description: [detailed description of the enhancement]
|
||||
- Expected Benefits: [how this would improve PentAGI]
|
||||
|
||||
Example Scenario:
|
||||
[Provide a concrete example of how this enhancement would be used]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Technical Details
|
||||
description: If you have technical suggestions for implementation, please share them.
|
||||
placeholder: |
|
||||
Implementation Approach:
|
||||
- Architecture Changes: [any changes needed to current architecture]
|
||||
- New Components: [any new services or integrations needed]
|
||||
- Dependencies: [new tools or libraries required]
|
||||
|
||||
Integration Points:
|
||||
- AI Agents: [how it affects agent behavior]
|
||||
- Memory System: [data storage requirements]
|
||||
- Monitoring: [new metrics or traces needed]
|
||||
|
||||
Security Considerations:
|
||||
- [Any security implications to consider]
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Designs and Mockups
|
||||
description: |
|
||||
If applicable, provide mockups, diagrams, or examples to illustrate your enhancement.
|
||||
- For UI changes: wireframes or mockups
|
||||
- For architecture changes: system diagrams
|
||||
- For agent behavior: sequence diagrams
|
||||
placeholder: |
|
||||
Drag and drop images here, or provide links to external design tools.
|
||||
|
||||
For complex diagrams, you can use Mermaid syntax:
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
User->>PentAGI: Request
|
||||
PentAGI->>NewComponent: Process
|
||||
NewComponent->>User: Enhanced Response
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Alternative Solutions
|
||||
description: |
|
||||
Please describe any alternative solutions or features you've considered.
|
||||
placeholder: |
|
||||
Alternative Approaches:
|
||||
1. [First alternative approach]
|
||||
- Pros: [benefits]
|
||||
- Cons: [drawbacks]
|
||||
|
||||
2. [Second alternative approach]
|
||||
- Pros: [benefits]
|
||||
- Cons: [drawbacks]
|
||||
|
||||
Reason for Preferred Solution:
|
||||
[Explain why your main proposal is better than these alternatives]
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
id: verification
|
||||
attributes:
|
||||
label: Verification
|
||||
description: Please verify the following before submitting
|
||||
options:
|
||||
- label: I have checked that this enhancement hasn't been already proposed
|
||||
- label: This enhancement aligns with PentAGI's goal of autonomous penetration testing
|
||||
- label: I have considered the security implications of this enhancement
|
||||
- label: I have provided clear use cases and benefits
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,120 @@
|
||||
<!--
|
||||
Thank you for your contribution to PentAGI! Please fill out this template completely to help us review your changes effectively.
|
||||
Any PR that does not include enough information may be closed at maintainers' discretion.
|
||||
-->
|
||||
|
||||
### Description of the Change
|
||||
<!--
|
||||
We must be able to understand the design of your change from this description. Please provide as much detail as possible.
|
||||
-->
|
||||
|
||||
#### Problem
|
||||
<!-- Describe the problem this PR addresses -->
|
||||
|
||||
#### Solution
|
||||
<!-- Describe your solution and its key aspects -->
|
||||
|
||||
<!-- Enter any applicable Issue number(s) here that will be closed/resolved by this PR. -->
|
||||
Closes #
|
||||
|
||||
### Type of Change
|
||||
<!-- Mark with an `x` all options that apply -->
|
||||
|
||||
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] 🚀 New feature (non-breaking change which adds functionality)
|
||||
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] 📚 Documentation update
|
||||
- [ ] 🔧 Configuration change
|
||||
- [ ] 🧪 Test update
|
||||
- [ ] 🛡️ Security update
|
||||
|
||||
### Areas Affected
|
||||
<!-- Mark with an `x` all components that are affected -->
|
||||
|
||||
- [ ] Core Services (Frontend UI/Backend API)
|
||||
- [ ] AI Agents (Researcher/Developer/Executor)
|
||||
- [ ] Security Tools Integration
|
||||
- [ ] Memory System (Vector Store/Knowledge Base)
|
||||
- [ ] Monitoring Stack (Grafana/OpenTelemetry)
|
||||
- [ ] Analytics Platform (Langfuse)
|
||||
- [ ] External Integrations (LLM/Search APIs)
|
||||
- [ ] Documentation
|
||||
- [ ] Infrastructure/DevOps
|
||||
|
||||
### Testing and Verification
|
||||
<!--
|
||||
Please describe the tests that you ran to verify your changes and provide instructions so we can reproduce.
|
||||
-->
|
||||
|
||||
#### Test Configuration
|
||||
```yaml
|
||||
PentAGI Version:
|
||||
Docker Version:
|
||||
Host OS:
|
||||
LLM Provider:
|
||||
Enabled Features: [Langfuse/Grafana/etc]
|
||||
```
|
||||
|
||||
#### Test Steps
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
#### Test Results
|
||||
<!-- Include relevant screenshots, logs, or test outputs -->
|
||||
|
||||
### Security Considerations
|
||||
<!--
|
||||
Describe any security implications of your changes.
|
||||
For security-related changes, please note any new dependencies, changed permissions, etc.
|
||||
-->
|
||||
|
||||
### Performance Impact
|
||||
<!--
|
||||
Describe any performance implications and testing done to verify acceptable performance.
|
||||
Especially important for changes affecting AI agents, memory systems, or data processing.
|
||||
-->
|
||||
|
||||
### Documentation Updates
|
||||
<!-- Note any documentation changes required by this PR -->
|
||||
|
||||
- [ ] README.md updates
|
||||
- [ ] API documentation updates
|
||||
- [ ] Configuration documentation updates
|
||||
- [ ] GraphQL schema updates
|
||||
- [ ] Other: <!-- specify -->
|
||||
|
||||
### Deployment Notes
|
||||
<!--
|
||||
Describe any special considerations for deploying this change.
|
||||
Include any new environment variables, configuration changes, or migration steps.
|
||||
-->
|
||||
|
||||
### Checklist
|
||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
|
||||
#### Code Quality
|
||||
- [ ] My code follows the project's coding standards
|
||||
- [ ] I have added/updated necessary documentation
|
||||
- [ ] I have added tests to cover my changes
|
||||
- [ ] All new and existing tests pass
|
||||
- [ ] I have run `go fmt` and `go vet` (for Go code)
|
||||
- [ ] I have run `pnpm run lint` (for TypeScript/JavaScript code)
|
||||
|
||||
#### Security
|
||||
- [ ] I have considered security implications
|
||||
- [ ] Changes maintain or improve the security model
|
||||
- [ ] Sensitive information has been properly handled
|
||||
|
||||
#### Compatibility
|
||||
- [ ] Changes are backward compatible
|
||||
- [ ] Breaking changes are clearly marked and documented
|
||||
- [ ] Dependencies are properly updated
|
||||
|
||||
#### Documentation
|
||||
- [ ] Documentation is clear and complete
|
||||
- [ ] Comments are added for non-obvious code
|
||||
- [ ] API changes are documented
|
||||
|
||||
### Additional Notes
|
||||
<!-- Any additional information that would be helpful for reviewers -->
|
||||
@@ -0,0 +1,176 @@
|
||||
# Saved Replies
|
||||
|
||||
These are standardized responses for the PentAGI Development Team to use when responding to Issues and Pull Requests. Using these templates helps maintain consistency in our communications and saves time.
|
||||
|
||||
Since GitHub currently does not support repository-wide saved replies, team members should maintain these individually. All responses are versioned for easier updates.
|
||||
|
||||
While these are templates, please customize them to fit the specific context and:
|
||||
- Welcome new contributors
|
||||
- Thank them for their contribution
|
||||
- Provide context for your response
|
||||
- Outline next steps
|
||||
|
||||
You can add these saved replies to [your personal GitHub account here](https://github.com/settings/replies).
|
||||
|
||||
## Issue Responses
|
||||
|
||||
### Issue: Already Fixed (v1)
|
||||
```
|
||||
Thank you for reporting this issue! This has been resolved in a recent release. Please update to the latest version (see our [releases page](https://github.com/vxcontrol/pentagi/releases)) and verify if the issue persists.
|
||||
|
||||
If you continue experiencing problems after updating, please:
|
||||
1. Check your configuration against our documentation
|
||||
2. Provide logs from both PentAGI and monitoring systems (Grafana/Langfuse)
|
||||
3. Include details about your environment and enabled features
|
||||
```
|
||||
|
||||
### Issue: Need More Information (v1)
|
||||
```
|
||||
Thank you for your report! To help us better understand and address your issue, please provide additional information:
|
||||
|
||||
1. PentAGI version and deployment method (Docker Compose/Custom)
|
||||
2. Relevant logs from:
|
||||
- Docker containers
|
||||
- Grafana dashboards (if enabled)
|
||||
- Langfuse traces (if enabled)
|
||||
3. Steps to reproduce the issue
|
||||
4. Expected vs actual behavior
|
||||
|
||||
Please update your issue using our bug report template for consistency.
|
||||
```
|
||||
|
||||
### Issue: Cannot Reproduce (v1)
|
||||
```
|
||||
Thank you for reporting this issue! Unfortunately, I cannot reproduce the problem with the provided information. To help us investigate:
|
||||
|
||||
1. Verify you're using the latest version
|
||||
2. Provide your complete environment configuration
|
||||
3. Share relevant logs and monitoring data
|
||||
4. Include step-by-step reproduction instructions
|
||||
5. Specify which AI agents were involved (Researcher/Developer/Executor)
|
||||
|
||||
Please update your issue with these details so we can better assist you.
|
||||
```
|
||||
|
||||
### Issue: Expected Behavior (v1)
|
||||
```
|
||||
Thank you for your report! This appears to be the expected behavior because:
|
||||
|
||||
[Explanation of why this is working as designed]
|
||||
|
||||
If you believe this behavior should be different, please:
|
||||
1. Describe your use case in detail
|
||||
2. Explain why the current behavior doesn't meet your needs
|
||||
3. Suggest alternative behavior that would work better
|
||||
|
||||
We're always open to improving PentAGI's functionality.
|
||||
```
|
||||
|
||||
### Issue: Missing Template (v1)
|
||||
```
|
||||
Thank you for reporting this! To help us process your issue efficiently, please use our issue templates:
|
||||
|
||||
- [Bug Report Template](https://github.com/vxcontrol/pentagi/blob/master/.github/ISSUE_TEMPLATE/1-bug-report.md) for problems
|
||||
- [Enhancement Template](https://github.com/vxcontrol/pentagi/blob/master/.github/ISSUE_TEMPLATE/2-enhancement.md) for suggestions
|
||||
|
||||
Please edit your issue to include the template information. This helps ensure we have all necessary details to assist you.
|
||||
```
|
||||
|
||||
### Issue: PR Welcome (v1)
|
||||
```
|
||||
Thank you for raising this issue! We welcome contributions from the community.
|
||||
|
||||
If you'd like to implement this yourself:
|
||||
1. Check our [contribution guidelines](CONTRIBUTING.md)
|
||||
2. Review the architecture documentation
|
||||
3. Consider security implications (especially for AI agent modifications)
|
||||
4. Include tests and documentation
|
||||
5. Update monitoring/analytics as needed
|
||||
|
||||
Feel free to ask questions if you need guidance. We're here to help!
|
||||
```
|
||||
|
||||
## PR Responses
|
||||
|
||||
### PR: Ready to Merge (v1)
|
||||
```
|
||||
Excellent work! This PR meets our quality standards and I'll proceed with merging it.
|
||||
|
||||
If you're interested in further contributions, check our:
|
||||
- [Help Wanted Issues](https://github.com/vxcontrol/pentagi/labels/help-wanted)
|
||||
- [Good First Issues](https://github.com/vxcontrol/pentagi/labels/good-first-issue)
|
||||
|
||||
Thank you for improving PentAGI!
|
||||
```
|
||||
|
||||
### PR: Needs Work (v1)
|
||||
```
|
||||
Thank you for your contribution! A few items need attention before we can merge:
|
||||
|
||||
[List specific items that need addressing]
|
||||
|
||||
Common requirements:
|
||||
- Tests for new functionality
|
||||
- Documentation updates
|
||||
- Security considerations
|
||||
- Performance impact assessment
|
||||
- Monitoring/analytics integration
|
||||
|
||||
Please update your PR addressing these points. Let us know if you need any clarification.
|
||||
```
|
||||
|
||||
### PR: Missing Template (v1)
|
||||
```
|
||||
Thank you for your contribution! Please update your PR to use our [PR template](https://github.com/vxcontrol/pentagi/blob/master/.github/PULL_REQUEST_TEMPLATE.md).
|
||||
|
||||
The template helps ensure we have:
|
||||
- Clear description of changes
|
||||
- Testing information
|
||||
- Security considerations
|
||||
- Documentation updates
|
||||
- Deployment notes
|
||||
|
||||
This helps us review your changes effectively.
|
||||
```
|
||||
|
||||
### PR: Missing Issue (v1)
|
||||
```
|
||||
Thank you for your contribution! We require an associated issue for each PR to:
|
||||
- Discuss approach before implementation
|
||||
- Track related changes
|
||||
- Maintain clear project history
|
||||
|
||||
Please:
|
||||
1. [Create an issue](https://github.com/vxcontrol/pentagi/issues/new/choose)
|
||||
2. Link it to this PR
|
||||
3. Update the PR description with the issue reference
|
||||
|
||||
This helps us maintain good project organization.
|
||||
```
|
||||
|
||||
### PR: Inactive (v1)
|
||||
```
|
||||
This PR has been inactive for a while. To keep our review process efficient:
|
||||
|
||||
1. If you're still working on this:
|
||||
- Let us know your timeline
|
||||
- Update with latest main branch
|
||||
- Address any existing feedback
|
||||
|
||||
2. If you're no longer working on this:
|
||||
- We can close it
|
||||
- Someone else can pick it up
|
||||
|
||||
Please let us know your preference within the next week.
|
||||
```
|
||||
|
||||
### General: Need Help (v1)
|
||||
```
|
||||
I need additional expertise on this. Pinging:
|
||||
- @asdek for technical review
|
||||
- @security-team for security implications
|
||||
- @ai-team for AI agent behavior
|
||||
- @infra-team for infrastructure changes
|
||||
|
||||
[Specific questions or concerns that need addressing]
|
||||
```
|
||||
@@ -0,0 +1,206 @@
|
||||
name: Docker build and push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Go setup and cache
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '1.24'
|
||||
cache: true
|
||||
cache-dependency-path: backend/go.sum
|
||||
|
||||
# Cache Go dependencies
|
||||
- name: Go Mod Cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
# pnpm setup
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: frontend/package.json
|
||||
|
||||
# Node.js setup and cache
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '23'
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: 'frontend/pnpm-lock.yaml'
|
||||
|
||||
# Frontend lint and test
|
||||
- name: Frontend - Install dependencies
|
||||
working-directory: frontend
|
||||
run: pnpm install --frozen-lockfile
|
||||
continue-on-error: true
|
||||
|
||||
- name: Frontend - Prettier
|
||||
working-directory: frontend
|
||||
run: pnpm run prettier
|
||||
continue-on-error: true
|
||||
|
||||
- name: Frontend - Lint
|
||||
working-directory: frontend
|
||||
run: pnpm run lint
|
||||
continue-on-error: true
|
||||
|
||||
- name: Frontend - Test
|
||||
working-directory: frontend
|
||||
run: pnpm run test
|
||||
continue-on-error: true
|
||||
|
||||
# Backend lint and test
|
||||
- name: Backend - Download dependencies
|
||||
working-directory: backend
|
||||
run: go mod download
|
||||
continue-on-error: true
|
||||
|
||||
- name: Backend - Lint
|
||||
uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: latest
|
||||
working-directory: backend
|
||||
args: --timeout=5m --issues-exit-code=0
|
||||
continue-on-error: true
|
||||
|
||||
- name: Backend - Test
|
||||
working-directory: backend
|
||||
run: go test ./... -v
|
||||
continue-on-error: true
|
||||
|
||||
- name: Backend - Test Build
|
||||
working-directory: backend
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: on
|
||||
run: |
|
||||
# Get version information
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||
PACKAGE_VER=${LATEST_TAG#v}
|
||||
CURRENT_COMMIT=$(git rev-parse HEAD)
|
||||
TAG_COMMIT=$(git rev-list -n 1 "$LATEST_TAG" 2>/dev/null || echo "")
|
||||
|
||||
if [ "$CURRENT_COMMIT" != "$TAG_COMMIT" ]; then
|
||||
PACKAGE_REV=$(git rev-parse --short HEAD)
|
||||
else
|
||||
PACKAGE_REV=""
|
||||
fi
|
||||
|
||||
LDFLAGS="-X pentagi/pkg/version.PackageName=pentagi -X pentagi/pkg/version.PackageVer=${PACKAGE_VER} -X pentagi/pkg/version.PackageRev=${PACKAGE_REV}"
|
||||
|
||||
echo "Building with version: ${PACKAGE_VER}${PACKAGE_REV:+-$PACKAGE_REV}"
|
||||
|
||||
# Build for AMD64
|
||||
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "$LDFLAGS" -o /tmp/pentagi-amd64 ./cmd/pentagi
|
||||
echo "✓ Successfully built for linux/amd64"
|
||||
|
||||
# Build for ARM64
|
||||
GOOS=linux GOARCH=arm64 go build -trimpath -ldflags "$LDFLAGS" -o /tmp/pentagi-arm64 ./cmd/pentagi
|
||||
echo "✓ Successfully built for linux/arm64"
|
||||
continue-on-error: true
|
||||
|
||||
docker-build:
|
||||
needs: lint-and-test
|
||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# Extract version from tag (without 'v' prefix) and split into parts
|
||||
- name: Extract version and revision
|
||||
id: version
|
||||
run: |
|
||||
# Get latest tag version (without 'v' prefix)
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||
VERSION=${LATEST_TAG#v}
|
||||
|
||||
# Get current commit hash
|
||||
CURRENT_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
# Get commit hash of the latest tag
|
||||
TAG_COMMIT=$(git rev-list -n 1 "$LATEST_TAG" 2>/dev/null || echo "")
|
||||
|
||||
# Set revision only if current commit differs from tag commit
|
||||
if [ "$CURRENT_COMMIT" != "$TAG_COMMIT" ]; then
|
||||
PACKAGE_REV=$(git rev-parse --short HEAD)
|
||||
echo "revision=${PACKAGE_REV}" >> $GITHUB_OUTPUT
|
||||
echo "is_release=false" >> $GITHUB_OUTPUT
|
||||
echo "Building development version: ${VERSION}-${PACKAGE_REV}"
|
||||
echo " Docker tags: latest only"
|
||||
else
|
||||
echo "revision=" >> $GITHUB_OUTPUT
|
||||
echo "is_release=true" >> $GITHUB_OUTPUT
|
||||
echo "Building release version: ${VERSION}"
|
||||
|
||||
# Split version into major.minor.patch for Docker tags (only for releases)
|
||||
IFS='.' read -r major minor patch <<< "$VERSION"
|
||||
echo "major=${major}" >> $GITHUB_OUTPUT
|
||||
echo "minor=${major}.${minor}" >> $GITHUB_OUTPUT
|
||||
echo "patch=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo " Docker tags: latest, ${major}, ${major}.${minor}, ${VERSION}"
|
||||
fi
|
||||
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: vxcontrol/pentagi
|
||||
tags: |
|
||||
# For main branch - latest tag
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
# For release builds only - tag with major, minor and patch versions
|
||||
type=raw,value=${{ steps.version.outputs.major }},enable=${{ steps.version.outputs.is_release == 'true' }}
|
||||
type=raw,value=${{ steps.version.outputs.minor }},enable=${{ steps.version.outputs.is_release == 'true' }}
|
||||
type=raw,value=${{ steps.version.outputs.patch }},enable=${{ steps.version.outputs.is_release == 'true' }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64/v8
|
||||
push: true
|
||||
provenance: true
|
||||
sbom: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
PACKAGE_VER=${{ steps.version.outputs.version }}
|
||||
PACKAGE_REV=${{ steps.version.outputs.revision }}
|
||||
Reference in New Issue
Block a user