Skip to content

Commit c9aa254

Browse files
authored
Apply template (#43)
* Apply template * Include package in Sonar scans
1 parent a9a6d65 commit c9aa254

13 files changed

+893
-57
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_size = 4
9+
indent_style = space
10+
tab_width = 4
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
guidelines = 120
16+
17+
# JSON files
18+
[*.json]
19+
indent_size = 2
20+
21+
[*.yml]
22+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Please sort into logical groups with comment headers. Sort groups in order of specificity.
2+
# For example, default owners should always be the first group.
3+
# Sort lines alphabetically within these groups to avoid accidentally adding duplicates.
4+
#
5+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
6+
7+
# Default file owners
8+
* @bitwarden/team-admin-console-dev
9+
10+
# DevOps for Actions and other workflow changes
11+
.github/workflows @bitwarden/dept-devops

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## 🎟️ Tracking
2+
3+
<!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. -->
4+
5+
## 📔 Objective
6+
7+
<!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. -->
8+
9+
## ⏰ Reminders before review
10+
11+
- Contributor guidelines followed
12+
- All formatters and local linters executed and passed
13+
- Written new unit and / or integration tests where applicable
14+
- Protected functional changes with optionality (feature flags)
15+
- Used internationalization (i18n) for all UI strings
16+
- CI builds passed
17+
- Communicated to DevOps any deployment requirements
18+
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
19+
20+
## 🦮 Reviewer guidelines
21+
22+
<!-- Suggested interactions but feel free to use (or not) as you desire! -->
23+
24+
- 👍 (`:+1:`) or similar for great changes
25+
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
26+
- ❓ (`:question:`) for questions
27+
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
28+
- 🎨 (`:art:`) for suggestions / improvements
29+
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention
30+
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt
31+
- ⛏ (`:pick:`) for minor or nitpick changes

.github/renovate.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:base",
5-
":combinePatchMinorReleases",
6-
":dependencyDashboard",
7-
":maintainLockFilesWeekly",
8-
":pinAllExceptPeerDependencies",
9-
":prConcurrentLimit10",
10-
":rebaseStalePrs",
11-
"schedule:weekends",
12-
":separateMajorReleases"
13-
],
3+
"extends": ["github>bitwarden/renovate-config"],
144
"enabledManagers": ["github-actions", "poetry"],
155
"packageRules": [
166
{

.github/workflows/build.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ name: Build
33

44
on:
55
push:
6-
branches-ignore:
7-
- 'l10n_master'
8-
- 'gh-pages'
96
workflow_dispatch:
107
schedule:
118
# Splunk App Inspect checks - https://dev.splunk.com/enterprise/docs/whatsnew/#AppInspect-updates
12-
- cron: '0 0 1 * *'
9+
- cron: "0 0 1 * *"
1310

1411
jobs:
1512
cloc:
@@ -27,17 +24,16 @@ jobs:
2724
- name: Print lines of code
2825
run: cloc --include-lang CSS,JavaScript,XML,Python --vcs git
2926

30-
3127
build-artifacts:
3228
name: Build artifacts
3329
runs-on: ubuntu-22.04
3430
strategy:
3531
matrix:
3632
app:
37-
- id: 'bitwarden_event_logs'
38-
name: 'Bitwarden Event Logs'
39-
- id: 'bitwarden_event_logs_beta'
40-
name: 'Bitwarden Event Logs (beta)'
33+
- id: "bitwarden_event_logs"
34+
name: "Bitwarden Event Logs"
35+
- id: "bitwarden_event_logs_beta"
36+
name: "Bitwarden Event Logs (beta)"
4137
steps:
4238
- name: Checkout repo
4339
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -53,7 +49,7 @@ jobs:
5349
- name: Set up Python 3.7
5450
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # 4.7.1
5551
with:
56-
python-version: '3.7'
52+
python-version: "3.7"
5753

5854
- name: Print environment
5955
run: |
@@ -115,7 +111,6 @@ jobs:
115111
path: output/${{ matrix.app.id }}.tar.gz
116112
if-no-files-found: error
117113

118-
119114
check-failures:
120115
name: Check for failures
121116
if: always()

.github/workflows/scan.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Scan
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
- "rc"
9+
- "hotfix-rc"
10+
pull_request_target:
11+
types: [opened, synchronize]
12+
13+
jobs:
14+
check-run:
15+
name: Check PR run
16+
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
17+
18+
sast:
19+
name: SAST scan
20+
runs-on: ubuntu-22.04
21+
needs: check-run
22+
permissions:
23+
contents: read
24+
pull-requests: write
25+
security-events: write
26+
27+
steps:
28+
- name: Check out repo
29+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
30+
with:
31+
ref: ${{ github.event.pull_request.head.sha }}
32+
33+
- name: Scan with Checkmarx
34+
uses: checkmarx/ast-github-action@5ba4f1660ef65ff6a519d3a7959171c52f26986f # 2.0.26
35+
env:
36+
INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
37+
with:
38+
project_name: ${{ github.repository }}
39+
cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
40+
base_uri: https://ast.checkmarx.net/
41+
cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
42+
cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
43+
additional_params: |
44+
--report-format sarif \
45+
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
46+
--output-path . ${{ env.INCREMENTAL }}
47+
48+
- name: Upload Checkmarx results to GitHub
49+
uses: github/codeql-action/upload-sarif@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # v3.25.4
50+
with:
51+
sarif_file: cx_result.sarif
52+
53+
quality:
54+
name: Quality scan
55+
runs-on: ubuntu-22.04
56+
needs: check-run
57+
permissions:
58+
contents: read
59+
pull-requests: write
60+
61+
steps:
62+
- name: Check out repo
63+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
64+
with:
65+
fetch-depth: 0
66+
ref: ${{ github.event.pull_request.head.sha }}
67+
68+
- name: Scan with SonarCloud
69+
uses: sonarsource/sonarcloud-github-action@49e6cd3b187936a73b8280d59ffd9da69df63ec9 # v2.1.1
70+
env:
71+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
args: >
75+
-Dsonar.organization=${{ github.repository_owner }}
76+
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
77+
-Dsonar.sources=src/,package/
78+
-Dsonar.tests=tests/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ package/lib/
166166
!package/README/*
167167

168168
requests.http
169-
splunk_session.txt
169+
splunk_session.txt

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# How to Contribute
2+
3+
Our [Contributing Guidelines](https://contributing.bitwarden.com/contributing/) are located in our [Contributing Documentation](https://contributing.bitwarden.com/). The documentation also includes recommended tooling, code style tips, and lots of other great information to get you started.

0 commit comments

Comments
 (0)