Skip to content

Commit d81281b

Browse files
authored
chore: workflow cleanup (#48)
Signed-off-by: Jeremy Andrews <[email protected]>
1 parent 0edc270 commit d81281b

10 files changed

+43
-26
lines changed

.github/workflows/contributor-workflow.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This workflow analyzes the Dart Server SDK and a Go-feature-integration example project
2-
# to identify issues and commits for resolution.
1+
# This workflow analyzes the Dart Server SDK and an example project
32

43
name: Contributor Workflow
54

.github/workflows/parent-pipeline.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ jobs:
6060
# with:
6161
# branch_name: ${{ needs.determine-workflow.outputs.branch_name }}
6262
# event_name: ${{ needs.determine-workflow.outputs.event_name }}
63-
63+
# trigger-development-workflow:
64+
# name: Trigger Development Workflow
65+
# needs: trigger-validation
66+
# if: |
67+
# github.event_name == 'pull_request' &&
68+
# github.base_ref == 'development'
69+
# uses: ./.github/workflows/development-workflow.yml
6470
# trigger-beta-workflow:
6571
# name: Trigger Beta Workflow
6672
# needs: trigger-validation

.github/workflows/release.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,21 @@ jobs:
3333
release_tag_name: ${{ steps.release.outputs.tag_name }}
3434
upload_url: ${{ steps.release.outputs.upload_url }}
3535

36+
# Publishing is handled in publish.yaml
37+
dart-release:
38+
needs: release-please
39+
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
id-token: write # Required for authentication using OIDC
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
- uses: dart-lang/setup-dart@v1
48+
- name: Install dependencies
49+
run: dart pub get
50+
- name: Publish
51+
run: dart pub publish --force
52+
3653
# Publishing is handled in publish.yaml

.github/workflows/validation-workflow.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow valides that branch and commit names are standardized for better workflow.
1+
# This workflow valides that branch and commit names are standardized.
22

33
name: Validation Workflow
44

@@ -24,13 +24,13 @@ jobs:
2424
BRANCH_NAME="${{ inputs.branch_name }}"
2525
echo "Branch name: $BRANCH_NAME"
2626
27-
if [[ "$BRANCH_NAME" =~ ^(qa|development|main)$ ]]; then
27+
if [[ "$BRANCH_NAME" =~ ^(qa|development|main|release-please--branches--main--components--openfeature_dart_server_sdk)$ ]]; then
2828
echo "✅ Branch name '$BRANCH_NAME' is valid for protected branches (qa, development, main)."
2929
elif [[ "$BRANCH_NAME" =~ ^(feat|fix|hotfix|chore|test|refactor|release)/[a-z0-9_-]+$ ]]; then
3030
echo "✅ Branch name '$BRANCH_NAME' follows the naming convention."
3131
else
3232
echo "❌ Branch name '$BRANCH_NAME' does not follow the naming convention: <type>/<branch-name>"
33-
echo "Valid types: feat, fix, hotfix, chore, test, refactor, release, development, qa, main"
33+
echo "Valid types: feat, fix, hotfix, chore, test, refactor, release, qa, main, development"
3434
exit 1
3535
fi
3636

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.dart_tool/
1+
.dart_tool/
2+
pubspec.lock

CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
Thank you for contributing to this project. We value your input, and any issues or pull requests adhering to these guidelines are welcome.
44

5-
6-
75
## **Code of Conduct**
86

97
Please read and follow our [Code of Conduct](https://github.com/open-feature/.github/blob/main/CODE_OF_CONDUCT.md).
108
**TL;DR**: Be respectful and professional.
119

12-
1310
## **Vendor Specific Details**
1411

1512
Vendor specific details are intentionally not included in this module in order to be lightweight and agnostic.
@@ -168,7 +165,9 @@ We follow [Conventional Commits](https://www.conventionalcommits.org) to ensure
168165
To maintain consistency and ensure stability, we enforce the following **branch protection rules**:
169166
170167
#### **Protected Branches**
171-
- **Branches**: `main`, `qa`, `beta`
168+
169+
- **Branches**: `main`, `qa`, `development`
170+
172171
- **Rules**:
173172
- Direct **pushes** are not allowed.
174173
- Changes must go through a **pull request** and pass all required checks before merging.
@@ -185,7 +184,7 @@ To maintain consistency and ensure stability, we enforce the following **branch
185184
#### **Branch Lifecycle**
186185
- **Feature, Fix, Hotfix, Test Branches**:
187186
- Created by developers for specific tasks.
188-
- Merged into `main`, `qa`, or `beta` branches through pull requests.
187+
- Merged into `main`, `qa`, or `development` branches through pull requests.
189188
- Deleted after merging.
190189
191190
---
@@ -197,7 +196,8 @@ To maintain consistency and ensure stability, we enforce the following **branch
197196
- Pushes to these branches are allowed without restrictions.
198197
199198
2. **Pull Requests into Protected Branches**:
200-
- Protected branches (`main`, `qa`, `beta`) require pull requests.
199+
200+
- Protected branches (`main`, `qa`, `development`) require pull requests.
201201
- Pull requests trigger workflows for testing and validation.
202202
203203
3. **Validation on Push and Pull Requests**:

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<!-- x-release-please-start-version -->
1919
<a href="https://github.com/open-feature/dart-server-sdk/releases/tag/v0.0.7">
2020
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.7&color=blue&style=for-the-badge" />
21+
2122
</a>
2223
<a href="https://dart.dev/">
2324
<img alt="Built with Dart" src="https://img.shields.io/badge/Built%20with-Dart-blue.svg?style=for-the-badge" />
@@ -87,8 +88,6 @@ If the provider you're looking for hasn't been created yet, see the [develop a p
8788

8889
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:
8990

90-
91-
9291
### Targeting
9392

9493
Sometimes, the value of a flag must consider some dynamic criteria about the application or user, such as the user's location, IP, email address, or the server's location.

lib/feature_provider.dart

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum ProviderState {
1111
DEGRADED,
1212
RECONNECTING,
1313
PLUGIN_ERROR,
14-
MAINTENANCE
14+
MAINTENANCE,
1515
}
1616

1717
/// Provider configuration
@@ -118,7 +118,7 @@ class InMemoryProvider implements FeatureProvider {
118118
final ProviderConfig _config;
119119

120120
InMemoryProvider(this._flags, [ProviderConfig? config])
121-
: _config = config ?? const ProviderConfig();
121+
: _config = config ?? const ProviderConfig();
122122

123123
@override
124124
String get name => 'InMemoryProvider';
@@ -257,8 +257,4 @@ abstract class CommercialProvider implements FeatureProvider {
257257
ProviderState get state => _state;
258258

259259
// HTTP request implementation template
260-
Future<dynamic> _makeRequest(String path,
261-
{Map<String, dynamic>? params}) async {
262-
throw UnimplementedError('_makeRequest must be implemented by child class');
263-
}
264260
}

lib/transaction_context.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ class TransactionContext {
3535
/// Transaction context manager
3636
class TransactionContextManager {
3737
static final TransactionContextManager _instance =
38-
TransactionContextManager._internal();
38+
TransactionContextManager._internal(Duration(minutes: 5));
3939
final _contexts = <String, TransactionContext>{};
4040
final _contextStack = <String>[];
4141
final Duration _defaultTimeout;
4242

43-
TransactionContextManager._internal(
44-
[this._defaultTimeout = const Duration(minutes: 30)]);
43+
TransactionContextManager._internal(this._defaultTimeout);
4544

4645
factory TransactionContextManager() => _instance;
4746

local_dev_tools/validate_branch.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void main(List<String> args) {
1414

1515
print('Branch name: $branchName');
1616

17-
final validBranches = RegExp(r'^(qa|beta|main)$');
17+
final validBranches = RegExp(r'^(qa|development|main)$');
1818
final validFeatureBranch = RegExp(
1919
r'^(feat|fix|hotfix|chore|test|refactor|release)/[a-z0-9_-]+$',
2020
);
@@ -27,7 +27,7 @@ void main(List<String> args) {
2727
'❌ Branch name does not follow the required convention: <type>/<branch-name>',
2828
);
2929
print(
30-
'Valid types: feat, fix, hotfix, chore, test, refactor, release, development, qa, main',
30+
'Valid types: feat, fix, hotfix, chore, test, refactor, release, qa, development, main',
3131
);
3232
exit(1);
3333
}

0 commit comments

Comments
 (0)