Skip to content

Commit 1e25b29

Browse files
authored
Merge pull request #1 from redis-developer/intro
Add Entra ID Authentication Support for Redis ( `go-redis` )
2 parents 8ab8224 + 5a37c4b commit 1e25b29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+8211
-9
lines changed

.githooks/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
goimports -l -w . # includes go fmt
4+
golangci-lint run # includes golint, go vet

.github/workflows/bench.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Benchmark Performance
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
push:
8+
branches:
9+
- master
10+
- main
11+
permissions:
12+
# deployments permission to deploy GitHub pages website
13+
deployments: write
14+
# contents permission to update benchmark contents in gh-pages branch
15+
contents: write
16+
17+
jobs:
18+
benchmark:
19+
name: Performance regression check
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v4
24+
with:
25+
go-version: "stable"
26+
- name: Install dependencies
27+
run: go mod tidy
28+
- name: Run benchmark
29+
run: go test ./... -bench=. -benchmem -count 2 -timeout 1m | tee benchmarks.txt
30+
# Download previous benchmark result from cache (if exists)
31+
- name: Download previous benchmark data
32+
uses: actions/cache@v4
33+
with:
34+
path: ./cache
35+
key: ${{ runner.os }}-benchmark
36+
# Run `github-action-benchmark` action
37+
- name: Store benchmark result
38+
uses: benchmark-action/github-action-benchmark@v1
39+
with:
40+
name: Go Benchmark
41+
tool: 'go'
42+
output-file-path: benchmarks.txt
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
auto-push: true
45+
# Show alert with commit comment on detecting possible performance regression
46+
alert-threshold: '200%'
47+
comment-on-alert: true
48+
fail-on-alert: true
49+
alert-comment-cc-users: '@ndyakov'

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install dependencies
2020
run: go mod tidy
2121
- name: Run tests with coverage
22-
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
22+
run: go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 2 -timeout 5m
2323
- name: Upload coverage
2424
uses: actions/upload-artifact@v4
2525
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
*.tar.gz
44
*.dic
55
coverage.txt
6+
cover.out
67
**/coverage.txt
8+
**/cover.out
79
.vscode
10+
tmp/

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "2"
2+
run:
3+
tests: false
4+
linters:
5+
disable:
6+
- depguard
7+

.testcoverage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ profile: cover.out
1111
threshold:
1212
# (optional; default 0)
1313
# Minimum coverage percentage required for individual files.
14-
file: 70
14+
file: 85
1515

1616
# (optional; default 0)
1717
# Minimum coverage percentage required for each package.
18-
package: 80
18+
package: 85
1919

2020
# (optional; default 0)
2121
# Minimum overall project coverage percentage required.
22-
total: 95
22+
total: 90
2323

2424
# Holds regexp rules which will override thresholds for matched files or packages
2525
# using their paths.
@@ -28,9 +28,9 @@ threshold:
2828
# new threshold to it. If project has multiple rules that match same path,
2929
# override rules should be listed in order from specific to more general rules.
3030
override:
31-
# Increase coverage threshold to 100% for `foo` package
32-
# (default is 80, as configured above in this example).
33-
- path: ^pkg/lib/foo$
31+
- path: ^internal$
32+
threshold: 95
33+
- path: ^token$
3434
threshold: 100
3535

3636
# Holds regexp rules which will exclude matched files or packages

CONTRIBUTING.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Contributing to go-redis-entraid
2+
3+
We welcome contributions from the community! If you'd like to contribute to this project, please follow these guidelines:
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Create a new branch for your feature or bugfix
9+
3. Make your changes
10+
4. Run the tests and ensure they pass
11+
5. Submit a pull request
12+
13+
## Development Setup
14+
15+
```bash
16+
# Clone your fork
17+
git clone https://github.com/your-username/go-redis-entraid.git
18+
cd go-redis-entraid
19+
20+
# Install dependencies
21+
go mod download
22+
23+
# Run tests
24+
go test ./...
25+
```
26+
27+
## Code Style and Standards
28+
29+
- Follow the Go standard formatting (`go fmt`)
30+
- Write clear and concise commit messages
31+
- Include tests for new features
32+
- Update documentation as needed
33+
- Follow the existing code style and patterns
34+
35+
## Testing
36+
37+
We maintain high test coverage for the project. When contributing:
38+
39+
- Add tests for new features
40+
- Ensure existing tests pass
41+
- Run the test coverage tool:
42+
```bash
43+
go test -coverprofile=cover.out ./...
44+
go tool cover -html=cover.out
45+
```
46+
47+
## Pull Request Process
48+
49+
1. Ensure your code passes all tests
50+
2. Update the README.md if necessary
51+
3. Submit your pull request with a clear description of the changes
52+
53+
## Reporting Issues
54+
55+
If you find a bug or have a feature request:
56+
57+
1. Check the existing issues to avoid duplicates
58+
2. Create a new issue with:
59+
- A clear title and description
60+
- Steps to reproduce (for bugs)
61+
- Expected and actual behavior
62+
- Environment details (Go version, OS, etc.)
63+
64+
## Development Workflow
65+
66+
1. Create a new branch for your feature/fix:
67+
```bash
68+
git checkout -b feature/your-feature-name
69+
```
70+
71+
2. Make your changes and commit them:
72+
```bash
73+
git add .
74+
git commit -m "Description of your changes"
75+
```
76+
77+
3. Push your changes to your fork:
78+
```bash
79+
git push origin feature/your-feature-name
80+
```
81+
82+
4. Create a pull request from your fork to the main repository
83+
84+
## Review Process
85+
86+
- All pull requests will be reviewed by maintainers
87+
- Be prepared to make changes based on feedback
88+
- Ensure your code meets the project's standards
89+
- Address any CI/CD failures
90+
91+
## Documentation
92+
93+
- Update relevant documentation when making changes
94+
- Include examples for new features
95+
- Update the README if necessary
96+
- Add comments to complex code sections
97+
98+
## Questions?
99+
100+
If you have any questions about contributing, please:
101+
1. Check the existing documentation
102+
2. Look through existing issues
103+
3. Create a new issue if your question hasn't been answered

0 commit comments

Comments
 (0)