Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance mode with flags #54

Merged
merged 6 commits into from
Feb 2, 2023
Merged

Maintenance mode with flags #54

merged 6 commits into from
Feb 2, 2023

Conversation

peterfox
Copy link
Collaborator

@peterfox peterfox commented Jan 31, 2023

Changes In Code

  • Added a Maintenance Mode driver
  • Adds tests for this
  • Adds an extension of the PreventRequestsDuringMaintenance to allow the use of the except value otherwise, this won't work.

Issue ticket number / Business Case

Maintenance Mode within the package will allow for more complex configurations where the feature flags decide the state of maintenance mode and how the application should handle things in the event of a problem.

Example code:

Features::maintenanceMode()
            ->onEnabled('system.api')
            ->statusCode(500);

Checklist before requesting a review

  • I have written PHP tests.
  • I have updated the documentation in the readme where needed.
  • I have checked code styles, PHPStan etc. pass.
  • I have provided an issue/business case.

@peterfox peterfox added the enhancement New feature or request label Jan 31, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #54 (1622945) into main (c9869c6) will increase coverage by 2.77%.
The diff coverage is 94.73%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main      #54      +/-   ##
============================================
+ Coverage     80.26%   83.03%   +2.77%     
- Complexity      170      201      +31     
============================================
  Files            27       31       +4     
  Lines           461      554      +93     
============================================
+ Hits            370      460      +90     
- Misses           91       94       +3     
Impacted Files Coverage Δ
src/Facades/Features.php 100.00% <ø> (ø)
src/Support/MaintenanceRepository.php 85.71% <85.71%> (ø)
src/FeatureFlagsServiceProvider.php 98.55% <100.00%> (+0.33%) ⬆️
src/Manager.php 60.38% <100.00%> (+0.52%) ⬆️
...c/Middlewares/PreventRequestsDuringMaintenance.php 100.00% <100.00%> (ø)
src/Support/MaintenanceDriver.php 100.00% <100.00%> (ø)
src/Support/MaintenanceScenario.php 100.00% <100.00%> (ø)
src/Support/FeatureFake.php 100.00% <0.00%> (+8.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@peterfox peterfox marked this pull request as ready for review January 31, 2023 21:28
@peterfox peterfox merged commit b36ac69 into main Feb 2, 2023
@peterfox peterfox deleted the feature/maintenance-mode branch February 2, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants