Skip to content

Commit

Permalink
SLC 6 - The Need for Speed (#163)
Browse files Browse the repository at this point in the history
* feature: cached earnings

* feature: merge product caching into main database migrations

* wip: slc6 functionality

* wip: super hyper slc6 upgrades

* qa refactor

* test: improve tests for refactor

* build: update dependencies

* feature: product-summary box query improvement

* feature: generic modal implementation

* test: update test layout

* style: funky drop shadow

* style: retro neo brutalism

* style: retro neo brutalism

* fix: split-editor OK button improvement
closes #162

* fix: modal understands context shift between window.top and window
closes #161
  • Loading branch information
g105b authored Mar 13, 2024
1 parent e9baeec commit b44acaf
Show file tree
Hide file tree
Showing 195 changed files with 2,052 additions and 2,625 deletions.
133 changes: 40 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,59 +33,6 @@ jobs:
name: build-artifact
path: /tmp/github-actions

phpunit:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3 ]

outputs:
coverage: ${{ steps.store-coverage.outputs.coverage_text }}

steps:
- uses: actions/download-artifact@v3
with:
name: build-artifact
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Unit tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: cover
with:
php_version: ${{ matrix.php }}
php_extensions: xdebug zip
coverage_text: _coverage/coverage.txt
coverage_clover: _coverage/clover.xml

- name: Store coverage data
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: _coverage

coverage:
runs-on: ubuntu-latest
needs: [ phpunit ]

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: code-coverage
path: _coverage

- name: Output coverage
run: cat "_coverage/coverage.txt"

- name: Upload to Codecov
uses: codecov/codecov-action@v3

phpstan:
runs-on: ubuntu-latest
needs: [ composer ]
Expand Down Expand Up @@ -156,49 +103,49 @@ jobs:
path: class/
standard: phpcs.xml

# behat:
# runs-on: ubuntu-latest
# needs: [ composer ]
# strategy:
# matrix:
# php: [ 8.2 ]
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: build-artifact
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - name: Behat
# uses: php-actions/behat@v1
# with:
# php_version: ${{ matrix.php }}
# behat:
# runs-on: ubuntu-latest
# needs: [ composer ]
# strategy:
# matrix:
# php: [ 8.2 ]
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: build-artifact
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - name: Behat
# uses: php-actions/behat@v1
# with:
# php_version: ${{ matrix.php }}


# dev-deploy:
# runs-on: ubuntu-latest
# needs: [ composer, phpunit, phpstan, phpcs, phpmd ]
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: build-artifact
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - uses: php-actions/deploy-ssh@master
# with:
# hostname: deploy-endpoint.dev.trackshift.app
# user: deploy
# path: /var/www/trackshift
# path_owner: www-data.
# ssh_key: ${{ secrets.deploy_ssh_key }}
# after_command: ./vendor/bin/gt build
# runs-on: ubuntu-latest
# needs: [ composer, phpunit, phpstan, phpcs, phpmd ]
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: build-artifact
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - uses: php-actions/deploy-ssh@master
# with:
# hostname: deploy-endpoint.dev.trackshift.app
# user: deploy
# path: /var/www/trackshift
# path_owner: www-data.
# ssh_key: ${{ secrets.deploy_ssh_key }}
# after_command: ./vendor/bin/gt build

remove_old_artifacts:
runs-on: ubuntu-latest
Expand Down
17 changes: 7 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/.idea
/vendor/
/data/
/ts.db
/config.*.ini
/www/
.DS_Store
/.idea/
/style/.sass-cache style/
/www
*.phar
config.*.ini
access-token.dat
asset/font/.DS_Store
asset/.DS_Store
/test/phpunit/_coverage/
.phpunit*.cache
/data/cache
/data/upload
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ Within the `class` directory are namespace-organised directories. Organised with
- `ProductEarning`: Usages are converted into earnings which represent the different `Money` amounts associated to each usage of a Product: earning, cost, outgoing, profit.
- `Cost`: Costs can be added to Products which will be subtracted from the earning.
- `Split`: Splits can be added to Products to divide the remaining profit between different parties, according to their `SplitPercentage` value. A special type of percentage `RemainderSplitPercentage` is always added to a `Split`, with a value that is calculated as the remaining split from 100%.

Database
--------

Since the first version, we've switched from SQLite to MySQL. (Insert quote about "how long until you realise MySQL is the solution?").

To achieve the features we need, MySQL imports directly from CSV. This is done by altering the
Binary file removed asset/.DS_Store
Binary file not shown.
Binary file removed asset/font/.DS_Store
Binary file not shown.
Binary file removed asset/font/geomanist/.DS_Store
Binary file not shown.
Binary file removed asset/img/.DS_Store
Binary file not shown.
Binary file removed asset/img/abstract/.DS_Store
Binary file not shown.
Binary file removed asset/img/product/.DS_Store
Binary file not shown.
12 changes: 6 additions & 6 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ default:
contexts:
- \Behat\MinkExtension\Context\MinkContext:
- \SHIFT\TrackShift\BehatContext\ServerContext:
- \SHIFT\TrackShift\BehatContext\AuthContext:
- \SHIFT\TrackShift\BehatContext\PageContext:
- \SHIFT\TrackShift\BehatContext\UploadContext:
- \SHIFT\TrackShift\BehatContext\ProductContext:
- \SHIFT\TrackShift\BehatContext\SplitContext:
- \SHIFT\TrackShift\BehatContext\NotificationContext:
- \SHIFT\TrackShift\BehatContext\DebugContext:
- \SHIFT\TrackShift\BehatContext\AuthSteps:
- \SHIFT\TrackShift\BehatContext\UploadSteps:
- \SHIFT\TrackShift\BehatContext\ProductSteps:
- \SHIFT\TrackShift\BehatContext\SplitSteps:
- \SHIFT\TrackShift\BehatContext\NotificationSteps:
- \SHIFT\TrackShift\BehatContext\DebugSteps:

extensions:
Behat\MinkExtension:
Expand Down
13 changes: 0 additions & 13 deletions build.production.json

This file was deleted.

6 changes: 1 addition & 5 deletions class/Artist/ArtistRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ public function getById(string $id, User $user):?Artist {
}

public function getByName(string $artistName, User $user):?Artist {
return $this->rowToArtist($this->db->fetch("getArtistByName", $artistName, $user->id));
}

public function getByNormalisedName(string $normalisedName, User $user):?Artist {
return $this->rowToArtist($this->db->fetch("getArtistByNormalisedName", $normalisedName, $user->id));
return $this->rowToArtist($this->db->fetch("getArtistByNameNormalised", (string)(new NormalisedString($artistName)), $user->id));
}

private function rowToArtist(?Row $row):?Artist {
Expand Down
44 changes: 0 additions & 44 deletions class/Audit/AuditItem.php

This file was deleted.

Loading

0 comments on commit b44acaf

Please sign in to comment.