-
Notifications
You must be signed in to change notification settings - Fork 0
Release 2.15.3: Code quality improvements #128
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
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1dc3e5a
Add comment for developers
mtompset 83402f0
Revise doesUserMatch() to reduce complexity
mtompset dc0b022
Update dependencies and prepare version for release
mtompset 6944ddc
Remove extraneous parenthesis on return statements
mtompset 301ac39
Replace hard coded string with constant
mtompset 6e676c1
Use assertEquals not assertTrue
mtompset f02cde7
Use assertSame, not assertEquals
mtompset 648a98e
Create specific exceptions
mtompset 0c74dbb
Add missing newline
mtompset 55bd1ba
Add exception for GroupSettings not existing
mtompset 362e81e
Intentionally exclude recommends, but not necessary dependencies
mtompset d721c8e
Attempt to not use root
mtompset d116eef
Add a non-root user line at the top
mtompset 3e7309e
Make the nonroot user explicitly
mtompset 227f7f2
Avoid complete recursive copy
mtompset 962bf61
Specifically decide what to copy from the root directory
mtompset 3fc4a6e
Dockerfile layering clean ups
mtompset b5b4fc6
Make sure the development test databases exist and are writable
mtompset cec69c5
Address failures in GitHub actions testing
mtompset 0761caf
Make sure test data files are owned and have writable permissions
mtompset 66b6e56
Make sure everything is owned by nonroot:root to improve writability …
mtompset 8b7a107
Remove unused variable as the return value isn't checked
mtompset ff72216
Installing composer needs root, but running composer does not
mtompset 61866e6
Merge the two runs together
mtompset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,60 @@ | ||
| FROM php:8.2-apache | ||
| RUN useradd nonroot | ||
| LABEL maintainer="Mark Tompsett <mark_tompsett@sil.org>" | ||
|
|
||
| ENV REFRESHED_AT 2023-07-12 | ||
|
|
||
| # Make sure apt has current list/updates | ||
| USER root | ||
| RUN apt-get update -y \ | ||
| # Fix timezone stuff from hanging. | ||
| && echo "America/New_York" > /etc/timezone \ | ||
| && apt-get install -y tzdata \ | ||
| && apt-get install -y --no-install-recommends tzdata \ | ||
| && apt-get upgrade -y \ | ||
| # Install | ||
| && apt-get install -y \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| # things needed for GoogleMock objects | ||
| sqlite3 \ | ||
| # some basics | ||
| unzip wget zip \ | ||
| # Clean up to reduce docker image size | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| # Make sure the directory we'll mount and reference is there | ||
| && mkdir -p /data | ||
|
|
||
| RUN mkdir -p /data | ||
| USER nonroot | ||
| WORKDIR /data | ||
| COPY ./ /data | ||
| COPY actions-services.yml /data | ||
| COPY composer-install.sh /data | ||
| COPY composer.json /data | ||
| COPY composer.lock /data | ||
| COPY docker-compose.yml /data | ||
| COPY Dockerfile /data | ||
| COPY LICENSE /data | ||
| COPY Makefile /data | ||
| COPY README.md /data | ||
| COPY run-tests.sh /data | ||
| COPY .travis.yml /data | ||
| COPY SilMock/ /data/SilMock | ||
|
|
||
| RUN cd /data && ./composer-install.sh | ||
| RUN mv /data/composer.phar /usr/bin/composer | ||
| USER root | ||
| # Make sure the development test files exist and have writable permissions | ||
| RUN touch /data/SilMock/DataStore/Sqlite/Test1_Google_Service_Data.db && \ | ||
| touch /data/SilMock/DataStore/Sqlite/Test2_Google_Service_Data.db && \ | ||
| touch /data/SilMock/DataStore/Sqlite/Test3_Google_Service_Data.db && \ | ||
| touch /data/SilMock/DataStore/Sqlite/Test4_Google_Service_Data.db && \ | ||
| touch /data/SilMock/DataStore/Sqlite/Test5_Google_Service_Data.db && \ | ||
| touch /data/SilMock/tests/.phpunit.result.cache && \ | ||
| chown -R nonroot:root /data && \ | ||
| chmod 664 /data/SilMock/DataStore/Sqlite/Test1_Google_Service_Data.db && \ | ||
| chmod 664 /data/SilMock/DataStore/Sqlite/Test2_Google_Service_Data.db && \ | ||
| chmod 664 /data/SilMock/DataStore/Sqlite/Test3_Google_Service_Data.db && \ | ||
| chmod 664 /data/SilMock/DataStore/Sqlite/Test4_Google_Service_Data.db && \ | ||
| chmod 664 /data/SilMock/DataStore/Sqlite/Test5_Google_Service_Data.db && \ | ||
| chmod 664 /data/SilMock/tests/.phpunit.result.cache | ||
|
|
||
| WORKDIR /data | ||
| RUN ./composer-install.sh && mv /data/composer.phar /usr/bin/composer | ||
| USER nonroot | ||
| RUN /usr/bin/composer install | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
|
|
||
| namespace SilMock\exceptions; | ||
|
|
||
| use Exception; | ||
|
|
||
| class GroupAlreadyExistsException extends Exception | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
|
|
||
| namespace SilMock\exceptions; | ||
|
|
||
| use Exception; | ||
|
|
||
| class GroupDoesNotExistException extends Exception | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
|
|
||
| namespace SilMock\exceptions; | ||
|
|
||
| use Exception; | ||
|
|
||
| class GroupSettingsDoNotExistException extends Exception | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If at some point you want to simplify this (to possibly get rid of the need for a
composer-install.shscript), you can also just copy the composer binary from their Docker image, like so:You can use whatever version tag you want to, after the colon in that
--fromparameter.