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

Set MOJO_MODE for Docker Environment #96

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

bodo-hugo-barwich
Copy link
Contributor

@bodo-hugo-barwich bodo-hugo-barwich commented Dec 30, 2022

This development will revert changes in the CircleCI Automated Test Environment and add MOJO_MODE environment variables to the Docker environment in which the tests are run and which define actually the local development environment.

The Service api will be marked with MOJO_MODE set to "development".
And the Service api_test will be marked with MOJO_MODE set to "testing"

@bodo-hugo-barwich
Copy link
Contributor Author

bodo-hugo-barwich commented Dec 30, 2022

This is an important setting to clearly identify different environments and thereby protect different operations to only be available in clearly marked development and testing environments as required at:
Fix a Corrupted ElasticSearch Index

@oalders oalders merged commit cb870c4 into metacpan:master Dec 30, 2022
@bodo-hugo-barwich
Copy link
Contributor Author

bodo-hugo-barwich commented Jan 2, 2023

The CircleCI Automated Tests show that for the api_test service the localapi_test.env file is loaded which sets MOJO_MODE to "testing". This allows operations which are otherwise blocked like the --delete --all operation which clears all ElasticSearch indices.
CircleCI Automated Tests

Use of uninitialized value $ENV{"PLACK_ENV"} in concatenation (.) or string at t/lib/MetaCPAN/TestServer.pm line 377.
test_delete_fails - PLACK_ENV: ''
test_delete_fails - MOJO_MODE: 'testing'
2022/12/30 18:29:41 E mapping: Operation not permitted!
[2022/12/30 18:29:41] [catalyst] [ERROR] Operation not permitted!
2022/12/30 18:29:41 F mapping: Operation not permitted in environment: production
[2022/12/30 18:29:41] [catalyst] [FATAL] Operation not permitted in environment: production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants