bitwarden-workflow-linter 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bitwarden_workflow_linter-2.0.0/.claude/CLAUDE.md +142 -0
- bitwarden_workflow_linter-2.0.0/.claude/prompts/review-code.md +25 -0
- bitwarden_workflow_linter-2.0.0/.editorconfig +138 -0
- bitwarden_workflow_linter-2.0.0/.gitattributes +1 -0
- bitwarden_workflow_linter-2.0.0/.github/CODEOWNERS +20 -0
- bitwarden_workflow_linter-2.0.0/.github/ISSUE_TEMPLATE/config.yml +14 -0
- bitwarden_workflow_linter-2.0.0/.github/PULL_REQUEST_TEMPLATE.md +31 -0
- bitwarden_workflow_linter-2.0.0/.github/actionlint.yml +20 -0
- bitwarden_workflow_linter-2.0.0/.github/renovate.json +35 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/_version_type.yml +62 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/bwwl_operations.yml +188 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/cd.yml +209 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/ci.yml +131 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/enforce-labels.yml +24 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/ci.yaml +60 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/example-references/_build.yml +67 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/example-references/_docker.yml +92 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/example-references/_test.yml +57 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/example-references/_version.yml +71 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/example.yaml +126 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/pull_request_target.yml +32 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/examples/scan.yaml +172 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/respond.yml +28 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/review-code.yml +20 -0
- bitwarden_workflow_linter-2.0.0/.github/workflows/scan.yml +56 -0
- bitwarden_workflow_linter-2.0.0/.gitignore +43 -0
- bitwarden_workflow_linter-2.0.0/.husky/pre-commit +1 -0
- bitwarden_workflow_linter-2.0.0/.python-version +1 -0
- bitwarden_workflow_linter-2.0.0/CONTRIBUTING.md +3 -0
- bitwarden_workflow_linter-2.0.0/LICENSE.txt +674 -0
- bitwarden_workflow_linter-2.0.0/PKG-INFO +284 -0
- bitwarden_workflow_linter-2.0.0/Pipfile +24 -0
- bitwarden_workflow_linter-2.0.0/Pipfile.lock +925 -0
- bitwarden_workflow_linter-2.0.0/README.md +258 -0
- bitwarden_workflow_linter-2.0.0/RULE_ROLLOUT.md +43 -0
- bitwarden_workflow_linter-2.0.0/SECURITY.md +32 -0
- bitwarden_workflow_linter-2.0.0/Taskfile.yml +86 -0
- bitwarden_workflow_linter-2.0.0/package-lock.json +605 -0
- bitwarden_workflow_linter-2.0.0/package.json +30 -0
- bitwarden_workflow_linter-2.0.0/pylintrc +401 -0
- bitwarden_workflow_linter-2.0.0/pyproject.toml +45 -0
- bitwarden_workflow_linter-2.0.0/pyproject.toml.tpl +33 -0
- bitwarden_workflow_linter-2.0.0/settings.yaml +34 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/__about__.py +3 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/__init__.py +0 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/actionlint_version.yaml +1 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/actions.py +242 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/cli.py +53 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/default_actions.json +542 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/default_settings.yaml +34 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/lint.py +196 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/load.py +178 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/models/__init__.py +0 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/models/job.py +69 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/models/step.py +51 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/models/workflow.py +49 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rule.py +101 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/__init__.py +0 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/check_blocked_domains.py +180 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/check_pr_target.py +78 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/job_environment_prefix.py +81 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/name_capitalized.py +65 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/name_exists.py +61 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/permissions_exist.py +50 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/pinned_job_runner.py +54 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/run_actionlint.py +125 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/run_zizmor.py +145 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/step_approved.py +100 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/step_pinned.py +103 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/rules/underscore_outputs.py +122 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/utils.py +235 -0
- bitwarden_workflow_linter-2.0.0/src/bitwarden_workflow_linter/zizmor_version.yaml +1 -0
- bitwarden_workflow_linter-2.0.0/tests/__init__.py +0 -0
- bitwarden_workflow_linter-2.0.0/tests/conftest.py +3 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test-alt.yml +24 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test-blocked-domains.yml +34 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test-min-incorrect.yaml +9 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test-min.yaml +13 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test-outputs-incorrect.yml +45 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test.yml +61 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test_a.yaml +27 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test_workflow.yaml +32 -0
- bitwarden_workflow_linter-2.0.0/tests/fixtures/test_workflow_incorrect.yaml +36 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/__init__.py +0 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_check_blocked_domains.py +316 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_check_pr_target.py +330 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_job_environment_prefix.py +110 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_name_capitalized.py +130 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_name_exists.py +75 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_permissions_exist.py +150 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_pinned_job_runner.py +65 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_run_actionlint.py +377 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_run_zizmor.py +308 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_step_approved.py +116 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_step_pinned.py +119 -0
- bitwarden_workflow_linter-2.0.0/tests/rules/test_underscore_output.py +242 -0
- bitwarden_workflow_linter-2.0.0/tests/test_job.py +80 -0
- bitwarden_workflow_linter-2.0.0/tests/test_lint.py +47 -0
- bitwarden_workflow_linter-2.0.0/tests/test_load.py +94 -0
- bitwarden_workflow_linter-2.0.0/tests/test_rule.py +140 -0
- bitwarden_workflow_linter-2.0.0/tests/test_step.py +144 -0
- bitwarden_workflow_linter-2.0.0/tests/test_utils.py +35 -0
- bitwarden_workflow_linter-2.0.0/tests/test_workflow.py +97 -0
- bitwarden_workflow_linter-2.0.0/zizmor.yml +17 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Bitwarden Workflow Linter - Claude Instructions
|
|
2
|
+
|
|
3
|
+
## Repository Overview
|
|
4
|
+
|
|
5
|
+
**Bitwarden Workflow Linter** is an extensible Python CLI tool that enforces opinionated organization-specific GitHub Action standards.
|
|
6
|
+
|
|
7
|
+
**CRITICAL UNDERSTANDING**: This tool generates and publishes **rules that are consumed across ALL Bitwarden repositories**. Changes to rules affect the entire Bitwarden organization's CI/CD pipelines, not just this repository. Rules are distributed via PyPI and consumed by repositories through the [composite Action](https://github.com/bitwarden/gh-actions/tree/main/lint-workflow).
|
|
8
|
+
|
|
9
|
+
### High-Level Details
|
|
10
|
+
|
|
11
|
+
- **Type**: Python CLI application and library (~86 Python files)
|
|
12
|
+
- **Language**: Python 3.13.5 (minimum 3.11 supported)
|
|
13
|
+
- **Package Manager**: pipenv for dependencies, hatch for building/publishing
|
|
14
|
+
- **Distribution**: Published to PyPI as `bitwarden_workflow_linter`
|
|
15
|
+
- **CLI Command**: `bwwl`
|
|
16
|
+
- **Organizational Impact**: Rules affect CI/CD across entire Bitwarden codebase
|
|
17
|
+
|
|
18
|
+
## Build & Development Setup
|
|
19
|
+
|
|
20
|
+
### Essential Commands (Always run in this order)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Setup (REQUIRED before any development work)
|
|
24
|
+
pipenv install --dev
|
|
25
|
+
pipenv shell
|
|
26
|
+
pip install -e .
|
|
27
|
+
|
|
28
|
+
# Testing (ALWAYS run before submitting changes)
|
|
29
|
+
pytest tests --cov=src
|
|
30
|
+
|
|
31
|
+
# Code quality (REQUIRED before merging to main)
|
|
32
|
+
black .
|
|
33
|
+
pylint --rcfile pylintrc src/ tests/
|
|
34
|
+
|
|
35
|
+
# Type checking (Linux only)
|
|
36
|
+
pytype src
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Task Runner Shortcuts
|
|
40
|
+
|
|
41
|
+
- `task test:cov` - Run tests with coverage
|
|
42
|
+
- `task fmt` - Format code with black
|
|
43
|
+
- `task lint` - Run pylint
|
|
44
|
+
|
|
45
|
+
## Key Project Structure
|
|
46
|
+
|
|
47
|
+
**Rules Location**: `src/bitwarden_workflow_linter/rules/` - All linting rules
|
|
48
|
+
**Rule Base Class**: `src/bitwarden_workflow_linter/rule.py` - Extend this for new rules
|
|
49
|
+
**CLI Entry**: `src/bitwarden_workflow_linter/cli.py:main()`
|
|
50
|
+
**Configuration**:
|
|
51
|
+
|
|
52
|
+
- `settings.yaml` (local overrides)
|
|
53
|
+
- `src/bitwarden_workflow_linter/default_settings.yaml` (defaults)
|
|
54
|
+
|
|
55
|
+
## Rule Development - Organization-Wide Impact
|
|
56
|
+
|
|
57
|
+
**CRITICAL**: Rules developed here are distributed to and enforced across ALL Bitwarden repositories. Every rule change has organization-wide impact.
|
|
58
|
+
|
|
59
|
+
### Rule Distribution Flow
|
|
60
|
+
|
|
61
|
+
1. Rules developed/tested in this repository
|
|
62
|
+
2. Published to PyPI as `bitwarden_workflow_linter`
|
|
63
|
+
3. Consumed by all Bitwarden repositories via gh-actions/lint-workflow
|
|
64
|
+
4. Enforced in CI/CD pipelines organization-wide
|
|
65
|
+
5. Rule failures can block deployments across hundreds of repositories
|
|
66
|
+
|
|
67
|
+
### Rule Rollout Process (MANDATORY)
|
|
68
|
+
|
|
69
|
+
**Before making ANY rule changes, read `RULE_ROLLOUT.md`** - documents the careful process for organization-wide deployment.
|
|
70
|
+
|
|
71
|
+
**Key principles:**
|
|
72
|
+
|
|
73
|
+
- **Gradual Rollout**: New rules start as `warning`, then upgrade to `error`
|
|
74
|
+
- **Impact Assessment**: Test against representative workflows before activation
|
|
75
|
+
- **Communication**: Coordinate with teams before deploying breaking changes
|
|
76
|
+
|
|
77
|
+
### Adding New Rules
|
|
78
|
+
|
|
79
|
+
1. **CRITICAL**: Rules must be implemented, tested, and merged to main BEFORE activation
|
|
80
|
+
2. **CRITICAL**: Follow `RULE_ROLLOUT.md` process to avoid breaking organization CI
|
|
81
|
+
3. Extend `Rule` base class in `src/bitwarden_workflow_linter/rule.py`
|
|
82
|
+
4. Place in `src/bitwarden_workflow_linter/rules/`
|
|
83
|
+
5. Must define: `message`, `on_fail`, `compatibility`, `settings`, and `fn()` method
|
|
84
|
+
6. Add comprehensive tests with 100% coverage
|
|
85
|
+
7. Start with `warning` level, upgrade to `error` after validation period
|
|
86
|
+
8. After release, activate by adding to `settings.yaml` and `default_settings.yaml`
|
|
87
|
+
|
|
88
|
+
### Rule Impact Levels
|
|
89
|
+
|
|
90
|
+
- **ERROR Level**: Block CI/CD across all Bitwarden repositories - handle with extreme care
|
|
91
|
+
- **WARNING Level**: Generate notifications but don't block - safer for initial rollout
|
|
92
|
+
|
|
93
|
+
## Security Considerations
|
|
94
|
+
|
|
95
|
+
### Critical Security Rules (Organization-Wide)
|
|
96
|
+
|
|
97
|
+
- **Action Pinning**: `step_pinned.py` enforces SHA pinning (not tags) at ERROR level across all repos
|
|
98
|
+
- Example: `uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2`
|
|
99
|
+
- **Approved Actions**: `step_approved.py` enforces use of pre-approved actions only
|
|
100
|
+
- **Permissions**: `permissions_exist.py` enforces explicit permissions in workflows
|
|
101
|
+
- **PR Target Protection**: `check_pr_target.py` prevents dangerous `pull_request_target` usage
|
|
102
|
+
|
|
103
|
+
**Security rule changes affect organization-wide security posture - always coordinate with security team.**
|
|
104
|
+
|
|
105
|
+
## Critical Issues & Solutions
|
|
106
|
+
|
|
107
|
+
### Rule Activation Order
|
|
108
|
+
|
|
109
|
+
- **ERROR**: Activating rules before release causes import errors across all Bitwarden repositories
|
|
110
|
+
- **SOLUTION**: Always merge rule implementation first, then activate after PyPI release
|
|
111
|
+
|
|
112
|
+
### Organization-Wide Impact
|
|
113
|
+
|
|
114
|
+
- **ERROR**: Deploying ERROR-level rules without testing breaks CI across hundreds of repositories
|
|
115
|
+
- **SOLUTION**: Start with WARNING level, test extensively, coordinate rollout via `RULE_ROLLOUT.md`
|
|
116
|
+
|
|
117
|
+
### Testing Best Practices
|
|
118
|
+
|
|
119
|
+
- Tests change directories to avoid repo-specific paths
|
|
120
|
+
- Use `default_settings.yaml` instead of repo `settings.yaml` in tests
|
|
121
|
+
- Run with `--strict` flag to catch warnings as errors
|
|
122
|
+
- Test rules against diverse workflow patterns from different Bitwarden repositories
|
|
123
|
+
|
|
124
|
+
## Agent Instructions
|
|
125
|
+
|
|
126
|
+
**Trust these instructions first** - only search for additional information if incomplete or incorrect.
|
|
127
|
+
|
|
128
|
+
**CRITICAL AWARENESS**: This repository's rules are consumed across ALL Bitwarden repositories. Every change has organization-wide impact.
|
|
129
|
+
|
|
130
|
+
**Required sequence for changes:**
|
|
131
|
+
|
|
132
|
+
1. **Read `RULE_ROLLOUT.md` if working with rules** - understand organization-wide impact
|
|
133
|
+
2. `pipenv shell && pip install -e .`
|
|
134
|
+
3. `pytest tests --cov=src`
|
|
135
|
+
4. `black . && pylint --rcfile pylintrc src/ tests/`
|
|
136
|
+
5. Test CLI: `bwwl lint --files tests/fixtures`
|
|
137
|
+
|
|
138
|
+
**For rule development:**
|
|
139
|
+
|
|
140
|
+
- Rules affect hundreds of other Bitwarden repositories
|
|
141
|
+
- Start with WARNING level, coordinate rollout, upgrade to ERROR only after validation
|
|
142
|
+
- **Never deploy ERROR-level rules without extensive testing and coordination**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Please review this pull request with a focus on:
|
|
2
|
+
|
|
3
|
+
- Code quality and best practices
|
|
4
|
+
- Potential bugs or issues
|
|
5
|
+
- Security implications
|
|
6
|
+
- Performance considerations
|
|
7
|
+
|
|
8
|
+
Note: The PR branch is already checked out in the current working directory.
|
|
9
|
+
|
|
10
|
+
Provide a comprehensive review including:
|
|
11
|
+
|
|
12
|
+
- Summary of changes since last review
|
|
13
|
+
- Critical issues found (be thorough)
|
|
14
|
+
- Suggested improvements (be thorough)
|
|
15
|
+
- Good practices observed (be concise - list only the most notable items without elaboration)
|
|
16
|
+
- Action items for the author
|
|
17
|
+
- Leverage collapsible <details> sections where appropriate for lengthy explanations or code snippets to enhance human readability
|
|
18
|
+
|
|
19
|
+
When reviewing subsequent commits:
|
|
20
|
+
|
|
21
|
+
- Track status of previously identified issues (fixed/unfixed/reopened)
|
|
22
|
+
- Identify NEW problems introduced since last review
|
|
23
|
+
- Note if fixes introduced new issues
|
|
24
|
+
|
|
25
|
+
IMPORTANT: Be comprehensive about issues and improvements. For good practices, be brief - just note what was done well without explaining why or praising excessively.
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
# Code files
|
|
18
|
+
[*.{cs,csx,vb,vbx}]
|
|
19
|
+
indent_size = 4
|
|
20
|
+
|
|
21
|
+
# Xml project files
|
|
22
|
+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
|
|
23
|
+
indent_size = 2
|
|
24
|
+
|
|
25
|
+
# Xml config files
|
|
26
|
+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
|
27
|
+
indent_size = 2
|
|
28
|
+
|
|
29
|
+
# JSON files
|
|
30
|
+
[*.json]
|
|
31
|
+
indent_size = 2
|
|
32
|
+
|
|
33
|
+
# JS files
|
|
34
|
+
[*.{js,ts,scss,html}]
|
|
35
|
+
indent_size = 2
|
|
36
|
+
|
|
37
|
+
[*.{ts}]
|
|
38
|
+
quote_type = single
|
|
39
|
+
|
|
40
|
+
[*.{scss,yml,csproj}]
|
|
41
|
+
indent_size = 2
|
|
42
|
+
|
|
43
|
+
[*.sln]
|
|
44
|
+
indent_style = tab
|
|
45
|
+
|
|
46
|
+
# Dotnet code style settings:
|
|
47
|
+
[*.{cs,vb}]
|
|
48
|
+
# Sort using and Import directives with System.* appearing first
|
|
49
|
+
dotnet_sort_system_directives_first = true
|
|
50
|
+
# Avoid "this." and "Me." if not necessary
|
|
51
|
+
dotnet_style_qualification_for_field = false:suggestion
|
|
52
|
+
dotnet_style_qualification_for_property = false:suggestion
|
|
53
|
+
dotnet_style_qualification_for_method = false:suggestion
|
|
54
|
+
dotnet_style_qualification_for_event = false:suggestion
|
|
55
|
+
|
|
56
|
+
# Use language keywords instead of framework type names for type references
|
|
57
|
+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
|
58
|
+
dotnet_style_predefined_type_for_member_access = true:suggestion
|
|
59
|
+
|
|
60
|
+
# Suggest more modern language features when available
|
|
61
|
+
dotnet_style_object_initializer = true:suggestion
|
|
62
|
+
dotnet_style_collection_initializer = true:suggestion
|
|
63
|
+
dotnet_style_coalesce_expression = true:suggestion
|
|
64
|
+
dotnet_style_null_propagation = true:suggestion
|
|
65
|
+
dotnet_style_explicit_tuple_names = true:suggestion
|
|
66
|
+
|
|
67
|
+
# Prefix private members with underscore
|
|
68
|
+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
|
|
69
|
+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
|
|
70
|
+
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
|
|
71
|
+
|
|
72
|
+
dotnet_naming_symbols.private_fields.applicable_kinds = field
|
|
73
|
+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
|
|
74
|
+
|
|
75
|
+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
|
|
76
|
+
dotnet_naming_style.prefix_underscore.required_prefix = _
|
|
77
|
+
|
|
78
|
+
# Async methods should have "Async" suffix
|
|
79
|
+
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
|
|
80
|
+
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
|
|
81
|
+
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion
|
|
82
|
+
|
|
83
|
+
dotnet_naming_symbols.any_async_methods.applicable_kinds = method
|
|
84
|
+
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
|
|
85
|
+
dotnet_naming_symbols.any_async_methods.required_modifiers = async
|
|
86
|
+
|
|
87
|
+
dotnet_naming_style.end_in_async.required_prefix =
|
|
88
|
+
dotnet_naming_style.end_in_async.required_suffix = Async
|
|
89
|
+
dotnet_naming_style.end_in_async.capitalization = pascal_case
|
|
90
|
+
dotnet_naming_style.end_in_async.word_separator =
|
|
91
|
+
|
|
92
|
+
# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items.
|
|
93
|
+
dotnet_diagnostic.CS0618.severity = suggestion
|
|
94
|
+
|
|
95
|
+
# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items.
|
|
96
|
+
dotnet_diagnostic.CS0612.severity = suggestion
|
|
97
|
+
|
|
98
|
+
# Remove unnecessary using directives https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
|
|
99
|
+
dotnet_diagnostic.IDE0005.severity = warning
|
|
100
|
+
|
|
101
|
+
# CSharp code style settings:
|
|
102
|
+
[*.cs]
|
|
103
|
+
# Prefer "var" everywhere
|
|
104
|
+
csharp_style_var_for_built_in_types = true:suggestion
|
|
105
|
+
csharp_style_var_when_type_is_apparent = true:suggestion
|
|
106
|
+
csharp_style_var_elsewhere = true:suggestion
|
|
107
|
+
|
|
108
|
+
# Prefer method-like constructs to have a expression-body
|
|
109
|
+
csharp_style_expression_bodied_methods = true:none
|
|
110
|
+
csharp_style_expression_bodied_constructors = true:none
|
|
111
|
+
csharp_style_expression_bodied_operators = true:none
|
|
112
|
+
|
|
113
|
+
# Prefer property-like constructs to have an expression-body
|
|
114
|
+
csharp_style_expression_bodied_properties = true:none
|
|
115
|
+
csharp_style_expression_bodied_indexers = true:none
|
|
116
|
+
csharp_style_expression_bodied_accessors = true:none
|
|
117
|
+
|
|
118
|
+
# Suggest more modern language features when available
|
|
119
|
+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
|
120
|
+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
|
121
|
+
csharp_style_inlined_variable_declaration = true:suggestion
|
|
122
|
+
csharp_style_throw_expression = true:suggestion
|
|
123
|
+
csharp_style_conditional_delegate_call = true:suggestion
|
|
124
|
+
|
|
125
|
+
# Newline settings
|
|
126
|
+
csharp_new_line_before_open_brace = all
|
|
127
|
+
csharp_new_line_before_else = true
|
|
128
|
+
csharp_new_line_before_catch = true
|
|
129
|
+
csharp_new_line_before_finally = true
|
|
130
|
+
csharp_new_line_before_members_in_object_initializers = true
|
|
131
|
+
csharp_new_line_before_members_in_anonymous_types = true
|
|
132
|
+
|
|
133
|
+
# Namespace settings
|
|
134
|
+
csharp_style_namespace_declarations = file_scoped:warning
|
|
135
|
+
|
|
136
|
+
# Switch expression
|
|
137
|
+
dotnet_diagnostic.CS8509.severity = error # missing switch case for named enum value
|
|
138
|
+
dotnet_diagnostic.CS8524.severity = none # missing switch case for unnamed enum value
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1,20 @@
|
|
|
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/dept-bre
|
|
9
|
+
|
|
10
|
+
# AppSec owns default_actions, actionlint_version, and zizmor config files
|
|
11
|
+
src/bitwarden_workflow_linter/default_actions.json @bitwarden/team-appsec
|
|
12
|
+
src/bitwarden_workflow_linter/actionlint_version.yaml @bitwarden/team-appsec
|
|
13
|
+
zizmor.yml @bitwarden/team-appsec
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Docker-related files
|
|
17
|
+
**/Dockerfile @bitwarden/team-appsec @bitwarden/dept-bre
|
|
18
|
+
**/*.dockerignore @bitwarden/team-appsec @bitwarden/dept-bre
|
|
19
|
+
**/entrypoint.sh @bitwarden/team-appsec @bitwarden/dept-bre
|
|
20
|
+
**/docker-compose.yml @bitwarden/team-appsec @bitwarden/dept-bre
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Feature Requests
|
|
4
|
+
url: https://community.bitwarden.com/c/feature-requests/
|
|
5
|
+
about: Request new features using the Community Forums. Please search existing feature requests before making a new one.
|
|
6
|
+
- name: Bitwarden Community Forums
|
|
7
|
+
url: https://community.bitwarden.com
|
|
8
|
+
about: Please visit the community forums for general community discussion, support and the development roadmap.
|
|
9
|
+
- name: Customer Support
|
|
10
|
+
url: https://bitwarden.com/contact/
|
|
11
|
+
about: Please contact our customer support for account issues and general customer support.
|
|
12
|
+
- name: Security Issues
|
|
13
|
+
url: https://hackerone.com/bitwarden
|
|
14
|
+
about: We use HackerOne to manage security disclosures.
|
|
@@ -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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Configuration related to self-hosted runner.
|
|
2
|
+
self-hosted-runner:
|
|
3
|
+
# Labels of self-hosted runner in array of strings.
|
|
4
|
+
labels:
|
|
5
|
+
- terraform-provider-bitwarden-sm-linux
|
|
6
|
+
- qa-ubuntu-24.04-TSD-1534
|
|
7
|
+
- macos-26
|
|
8
|
+
- macos-26-xlarge
|
|
9
|
+
|
|
10
|
+
# Path-specific configurations.
|
|
11
|
+
paths:
|
|
12
|
+
# Glob pattern relative to the repository root for matching files. The path separator is always '/'.
|
|
13
|
+
# This example configures any YAML file under the '.github/workflows/' directory.
|
|
14
|
+
.github/workflows/**/*.{yml,yaml}:
|
|
15
|
+
# List of regular expressions to filter errors by the error messages.
|
|
16
|
+
ignore:
|
|
17
|
+
# Ignore the specific error from shellcheck
|
|
18
|
+
- 'shellcheck reported issue in this script: .+'
|
|
19
|
+
- 'property "(secret_no_env_one|secret_one)" is not defined in object type.*' # Needed for sm-action tests with dynamic output
|
|
20
|
+
- 'invalid runner name "node24" at runs.using in ".*" action defined at ".*". valid runners are "composite", "docker", and "node20"' # Temporary workaround until actionlint support for node24 is released
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": ["github>bitwarden/renovate-config"],
|
|
4
|
+
"enabledManagers": ["github-actions", "npm", "pipenv"],
|
|
5
|
+
"labels": ["version:patch"],
|
|
6
|
+
"packageRules": [
|
|
7
|
+
{
|
|
8
|
+
"groupName": "gh minor",
|
|
9
|
+
"matchManagers": ["github-actions"],
|
|
10
|
+
"matchUpdateTypes": ["minor", "patch"]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"groupName": "npm minor",
|
|
14
|
+
"matchManagers": ["npm"],
|
|
15
|
+
"matchUpdateTypes": ["minor", "patch"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"groupName": "pipenv minor",
|
|
19
|
+
"matchManagers": ["pipenv"],
|
|
20
|
+
"matchUpdateTypes": ["minor", "patch"]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"customManagers": [
|
|
24
|
+
{
|
|
25
|
+
"customType": "regex",
|
|
26
|
+
"fileMatch": ["^actionlint_version\\.yaml$"],
|
|
27
|
+
"matchStrings": [
|
|
28
|
+
"\"actionlint_version\":\\s*\"(?<currentValue>[^\"]+)\""
|
|
29
|
+
],
|
|
30
|
+
"depNameTemplate": "rhysd/actionlint",
|
|
31
|
+
"datasourceTemplate": "github-releases",
|
|
32
|
+
"versioningTemplate": "semver"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: _version_type
|
|
2
|
+
run-name: Get version type
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
outputs:
|
|
7
|
+
version_bump_type:
|
|
8
|
+
description: "version to be built"
|
|
9
|
+
value: ${{ jobs.version.outputs.bump_type }}
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
issues: read
|
|
14
|
+
pull-requests: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
version:
|
|
18
|
+
name: Calculate Version
|
|
19
|
+
runs-on: ubuntu-22.04
|
|
20
|
+
outputs:
|
|
21
|
+
bump_type: ${{ steps.bump-type.outputs.type }}
|
|
22
|
+
steps:
|
|
23
|
+
- name: Get PR ID
|
|
24
|
+
id: pr
|
|
25
|
+
env:
|
|
26
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
run: |
|
|
28
|
+
commit_message=$(
|
|
29
|
+
curl -s -L \
|
|
30
|
+
-H "Accept: application/vnd.github+json" \
|
|
31
|
+
-H "Authorization: Bearer $GH_TOKEN" \
|
|
32
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
33
|
+
https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} | \
|
|
34
|
+
jq -r ".commit.message"
|
|
35
|
+
)
|
|
36
|
+
ID=$(echo "$commit_message" | head -1 | grep -o "(#.*)" | grep -o "[0-9]*")
|
|
37
|
+
echo "id=$ID" >> $GITHUB_OUTPUT
|
|
38
|
+
|
|
39
|
+
- name: Get version bump type
|
|
40
|
+
id: bump-type
|
|
41
|
+
env:
|
|
42
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
PR_NUMBER: ${{ steps.pr.outputs.id }}
|
|
44
|
+
run: |
|
|
45
|
+
version_tag=$(
|
|
46
|
+
curl -s -L \
|
|
47
|
+
-H "Accept: application/vnd.github+json" \
|
|
48
|
+
-H "Authorization: Bearer $GH_TOKEN" \
|
|
49
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
50
|
+
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/labels | \
|
|
51
|
+
jq -r ".[].name" | grep "version"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Single Version label Enforcement (should go in CI...)
|
|
55
|
+
if [[ $(echo $version_tag | wc -w) -gt 1 ]]; then
|
|
56
|
+
echo "[!] multiple version labels found!"
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
version_type=$(echo $version_tag | cut -d ":" -f 2)
|
|
61
|
+
echo "Version Bump Type: $version_type"
|
|
62
|
+
echo "type=$version_type" >> $GITHUB_OUTPUT
|