Skip to content

Commit a7e8c1c

Browse files
committed
Project setup
1 parent d17caa4 commit a7e8c1c

22 files changed

+1329
-1
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: "🐛 Bug Report"
3+
description: Create a report to help us improve
4+
labels: [bug]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Describe the bug
10+
description: What is the problem? A clear and concise description of the bug.
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: current
16+
attributes:
17+
label: Current behavior
18+
description: |
19+
Please include full errors, uncaught exceptions, screenshots, and relevant logs.
20+
Using environment variable JFROG_CLI_LOG_LEVEL="DEBUG" upon running the command will provide more log information.
21+
validations:
22+
required: true
23+
24+
- type: textarea
25+
id: reproduction
26+
attributes:
27+
label: Reproduction steps
28+
description: |
29+
Provide steps to reproduce the behavior.
30+
validations:
31+
required: false
32+
33+
- type: textarea
34+
id: expected
35+
attributes:
36+
label: Expected behavior
37+
description: |
38+
What did you expect to happen?
39+
validations:
40+
required: false
41+
42+
- type: input
43+
id: cli-application-version
44+
attributes:
45+
label: JFrog CLI-Application version
46+
validations:
47+
required: true
48+
49+
- type: input
50+
id: cli-version
51+
attributes:
52+
label: JFrog CLI version (if applicable)
53+
description: using "jf --version"
54+
validations:
55+
required: false
56+
57+
- type: input
58+
id: os-version
59+
attributes:
60+
label: Operating system type and version
61+
validations:
62+
required: true
63+
64+
- type: input
65+
id: app-version
66+
attributes:
67+
label: JFrog Application version
68+
validations:
69+
required: false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: ⭐️ Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like to see**
14+
A clear and concise description of the new feature.
15+
16+
**Describe alternatives you've considered**
17+
If applicable, a clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: ❓ Question
3+
about: Ask a question
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- [ ] The pull request is targeting the `main` branch.
2+
- [ ] The code has been validated to compile successfully by running `go vet ./...`.
3+
- [ ] The code has been formatted properly using `go fmt ./...`.
4+
- [ ] All [static analysis checks](https://github.com/jfrog/jfrog-cli-application/actions/workflows/analysis.yml) passed.
5+
- [ ] All [tests](https://github.com/jfrog/jfrog-cli-application/actions/workflows/tests.yml) have passed. If this feature is not already covered by the tests, new tests have been added.
6+
- [ ] All integration tests have passed locally as they cannot be automated yet.
7+
- [ ] All changes are detailed at the description. if not already covered at [JFrog Documentation](https://github.com/jfrog/documentation), new documentation have been added.
8+
9+
-----

.github/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore for release
5+
categories:
6+
- title: Breaking Changes 🚨
7+
labels:
8+
- breaking change
9+
- title: Exciting New Features 🎉
10+
labels:
11+
- new feature
12+
- title: Improvements 🌱
13+
labels:
14+
- improvement
15+
- title: Bug Fixes 🛠
16+
labels:
17+
- bug
18+
- title: Other Changes 📚
19+
labels:
20+
- "*"

.github/scripts/gotest.sh

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
DEBUG="${DEBUG:-false}"
6+
GOCMD="${GOCMD:-go}"
7+
OUTFILE="${OUTFILE:-}"
8+
XUNIT_OUTFILE="${XUNIT_OUTFILE:-}"
9+
JSON_OUTFILE="${JSON_OUTFILE:-}"
10+
COVERAGE_OUTFILE="${COVERAGE_OUTFILE:-}"
11+
12+
function echoDebug {
13+
if [[ "${DEBUG}" == true ]]; then
14+
echo "[gotest.sh] $@"
15+
fi
16+
}
17+
18+
if [[ -n "${OUTFILE}" ]]; then
19+
mkdir -p "$(dirname "${OUTFILE}")"
20+
else
21+
OUTFILE="$(mktemp)"
22+
fi
23+
if [[ -n "${XUNIT_OUTFILE}" ]]; then
24+
mkdir -p "$(dirname "${XUNIT_OUTFILE}")"
25+
fi
26+
if [[ -n "${JSON_OUTFILE}" ]]; then
27+
mkdir -p "$(dirname "${JSON_OUTFILE}")"
28+
fi
29+
if [[ -n "${COVERAGE_OUTFILE}" ]]; then
30+
mkdir -p "$(dirname "${COVERAGE_OUTFILE}")"
31+
fi
32+
33+
echoDebug "GOCMD: ${GOCMD}"
34+
echoDebug "Raw output file: ${OUTFILE}"
35+
echoDebug "JSON output file: ${JSON_OUTFILE}"
36+
echoDebug "xUnit output file: ${XUNIT_OUTFILE}"
37+
echoDebug "Coverage output file: ${COVERAGE_OUTFILE}"
38+
39+
exitCodeFile="$(mktemp)"
40+
echo "0" > "${exitCodeFile}"
41+
declare -a modargs
42+
GORACE="-race"
43+
for value in "$@"; do
44+
if [ "$value" = "-norace" ]; then
45+
GORACE=""
46+
elif [ "$value" != "-race" ]; then
47+
modargs+=("$value")
48+
fi
49+
done
50+
modargs+=("$GORACE")
51+
52+
if [[ -n "${COVERAGE_OUTFILE}" ]]; then
53+
echoDebug "Collecting packages for coverage report..."
54+
coverpkg=""
55+
for pkg in $(go list ./...); do
56+
if [[ -n "${coverpkg}" ]]; then
57+
coverpkg="${coverpkg},"
58+
fi
59+
coverpkg="${coverpkg}${pkg}"
60+
done
61+
modargs+=("-coverpkg=${coverpkg}")
62+
modargs+=("-coverprofile=${COVERAGE_OUTFILE}")
63+
fi
64+
65+
if [[ -n "${XUNIT_OUTFILE}" ]]; then
66+
# jstemmer/go-junit-report requires verbose output
67+
modargs+=("-v")
68+
fi
69+
70+
echoDebug "Running ${GOCMD} test ${modargs[*]}"
71+
# Disable log coloring (ANSI codes are invalid xml characters)
72+
(2>&1 DEV_DISABLE_LOG_COLORS=true ${GOCMD} test ${modargs[*]} || echo "$?" > "${exitCodeFile}") | tee "${OUTFILE}"
73+
exitCode="$(cat "${exitCodeFile}")"
74+
echoDebug "Tests Exit Code: $exitCode"
75+
76+
if [[ -n "${JSON_OUTFILE}" ]]; then
77+
echoDebug "Gernerating JSON test report at: ${JSON_OUTFILE}"
78+
go tool test2json < "${OUTFILE}" > "${JSON_OUTFILE}"
79+
fi
80+
81+
if [[ -n "${XUNIT_OUTFILE}" ]]; then
82+
echoDebug "Ensuring jstemmer/go-junit-report is installed"
83+
${GOCMD} install github.com/jstemmer/[email protected]
84+
echoDebug "Generating xUnit test report at: ${XUNIT_OUTFILE}"
85+
go-junit-report < "${OUTFILE}" > "${XUNIT_OUTFILE}"
86+
fi
87+
88+
echoDebug "Done"
89+
exit "$exitCode"

.github/workflows/analysis.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Static Analysis"
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
tags-ignore:
7+
- '**'
8+
pull_request:
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
jobs:
13+
Go-Lint:
14+
name: Lint ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ ubuntu, windows, macos ]
19+
runs-on: ${{ matrix.os }}-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
26+
- name: Setup Go with cache
27+
uses: jfrog/.github/actions/install-go-with-cache@main
28+
29+
- name: Run Go vet
30+
run: go vet -v ./...
31+
32+
Static-Check:
33+
name: Static Check ubuntu-latest
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout Source
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Go with cache
40+
uses: jfrog/.github/actions/install-go-with-cache@main
41+
42+
- name: Run golangci linter
43+
uses: jfrog/.github/actions/golangci-lint@main
44+
45+
Go-Sec:
46+
name: Go-Sec ubuntu-latest
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout Source
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Go with cache
53+
uses: jfrog/.github/actions/install-go-with-cache@main
54+
55+
- name: Run Go-Sec scanner
56+
uses: jfrog/.github/actions/gosec-scanner@main
57+

.github/workflows/cla.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "CLA Assistant"
2+
on:
3+
# issue_comment triggers this action on each comment on issues and pull requests
4+
issue_comment:
5+
types: [ created ]
6+
pull_request_target:
7+
types: [ opened, synchronize ]
8+
9+
jobs:
10+
CLAssistant:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Run CLA Check
14+
uses: jfrog/.github/actions/cla@main
15+
with:
16+
event_comment_body: ${{ github.event.comment.body }}
17+
event_name: ${{ github.event_name }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
CLA_SIGN_TOKEN: ${{ secrets.CLA_SIGN_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Frogbot Scan Pull Request"
2+
on:
3+
pull_request_target:
4+
types: [ opened, synchronize ]
5+
permissions:
6+
pull-requests: write
7+
contents: read
8+
jobs:
9+
scan-pull-request:
10+
runs-on: ubuntu-latest
11+
# A pull request needs to be approved before Frogbot scans it. Any GitHub user who is associated with the
12+
# "frogbot" GitHub environment can approve the pull request to be scanned.
13+
environment: frogbot
14+
steps:
15+
- uses: jfrog/frogbot@v2
16+
env:
17+
JFROG_CLI_LOG_LEVEL: "DEBUG"
18+
# [Mandatory]
19+
# JFrog platform URL (This functionality requires version 3.29.0 or above of Xray)
20+
JF_URL: ${{ secrets.FROGBOT_URL }}
21+
22+
# [Mandatory if JF_USER and JF_PASSWORD are not provided]
23+
# JFrog access token with 'read' permissions on Xray service
24+
JF_ACCESS_TOKEN: ${{ secrets.FROGBOT_ACCESS_TOKEN }}
25+
26+
# [Mandatory]
27+
# The GitHub token is automatically generated for the job
28+
JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
# [Optional]
31+
# Configure the SMTP server to enable Frogbot to send emails with detected secrets in pull request scans.
32+
# SMTP server URL including should the relevant port: (Example: smtp.server.com:8080)
33+
# JF_SMTP_SERVER: ${{ secrets.JF_SMTP_SERVER }}
34+
35+
# [Mandatory if JF_SMTP_SERVER is set]
36+
# The username required for authenticating with the SMTP server.
37+
#JF_SMTP_USER: ${{ secrets.JF_SMTP_USER }}
38+
39+
# [Mandatory if JF_SMTP_SERVER is set]
40+
# The password associated with the username required for authentication with the SMTP server.
41+
# JF_SMTP_PASSWORD: ${{ secrets.JF_SMTP_PASSWORD }}
42+
43+
# [Optional]
44+
# List of comma separated email addresses to receive email notifications about secrets
45+
# detected during pull request scanning. The notification is also sent to the email set
46+
# in the committer git profile regardless of whether this variable is set or not.
47+
JF_EMAIL_RECEIVERS: "[email protected]"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Frogbot Scan Repository"
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# The repository will be scanned once a day at 00:00 GMT.
6+
- cron: "0 0 * * *"
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
security-events: write
11+
jobs:
12+
scan-repository:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
# The repository scanning will be triggered periodically on the following branches.
17+
branch: [ "main" ]
18+
steps:
19+
- uses: jfrog/frogbot@v2
20+
env:
21+
JFROG_CLI_LOG_LEVEL: "DEBUG"
22+
# [Mandatory]
23+
# JFrog platform URL (This functionality requires version 3.29.0 or above of Xray)
24+
JF_URL: ${{ secrets.FROGBOT_URL }}
25+
26+
# [Mandatory if JF_USER and JF_PASSWORD are not provided]
27+
# JFrog access token with 'read' permissions on Xray service
28+
JF_ACCESS_TOKEN: ${{ secrets.FROGBOT_ACCESS_TOKEN }}
29+
30+
# [Mandatory]
31+
# The GitHub token is automatically generated for the job
32+
JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
# [Mandatory]
35+
# The name of the branch on which Frogbot will perform the scan
36+
JF_GIT_BASE_BRANCH: ${{ matrix.branch }}

0 commit comments

Comments
 (0)