Skip to content

Commit

Permalink
Merge branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
ollybh committed Mar 5, 2024
2 parents 72e1ab8 + 4ac933b commit a8ac388
Show file tree
Hide file tree
Showing 788 changed files with 97,421 additions and 196,648 deletions.
58 changes: 58 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This configuration ensures the implementer/maintainer of a game is
# automatically added as a reviewer when a pull request is created.
#
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

lib/engine/game/g_1817* @crericha
lib/engine/game/g_1828* @crericha
lib/engine/game/g_1844* @crericha
lib/engine/game/g_1880* @crericha
lib/engine/game/g_18_ny* @crericha
lib/engine/game/g_18_usa* @crericha

lib/engine/game/g_1822_ca* @michaeljb
lib/engine/game/g_1846* @michaeljb
lib/engine/game/g_1868_wy* @michaeljb
lib/engine/game/g_18_los_angeles* @michaeljb
lib/engine/game/g_18_royal_gorge* @michaeljb
Makefile @michaeljb
TILES.md @michaeljb
docker-compose* @michaeljb
scripts/ @michaeljb

lib/engine/game/g_1825* @roseundy
lib/engine/game/g_1841* @roseundy
lib/engine/game/g_1860* @roseundy
lib/engine/game/g_1862* @roseundy
lib/engine/game/g_1873* @roseundy
lib/engine/game/g_1888* @roseundy
lib/engine/game/g_18_carolinas* @roseundy
lib/engine/game/g_18_mag* @roseundy
lib/engine/game/g_18_new_england* @roseundy
lib/engine/game/g_21_moon* @roseundy
lib/engine/game/g_rolling_stock* @roseundy

lib/engine/game/g_1822_africa* @vandamm
lib/engine/game/g_18_jpt* @vandamm
lib/engine/game/g_18_scan* @vandamm

lib/engine/game/g_18_cz* @zwergenpunk
lib/engine/game/g_1840* @zwergenpunk

lib/engine/game/g_18_al* @perwestling
lib/engine/game/g_18_ga* @perwestling
lib/engine/game/g_18_mex* @perwestling
lib/engine/game/g_18_ms* @perwestling
lib/engine/game/g_18_rhl* @perwestling
lib/engine/game/g_18_sj* @perwestling
lib/engine/game/g_18_tn* @perwestling
lib/engine/game/g_1824* @perwestling
lib/engine/game/g_1893* @perwestling

lib/engine/game/g_1858* @ollybh
lib/engine/game/g_1861* @ollybh
lib/engine/game/g_1867* @ollybh
lib/engine/game/g_18_ardennes* @ollybh
lib/engine/game/g_18_bf* @ollybh

lib/engine/game/g_1854* @andrewzwicky
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ If you are implementing a new game, please break up the changes into multiple PR
-->

### Before clicking "Create"
## Before clicking "Create"

- [ ] Branch is derived from the latest `master`
- [ ] Add the `pins` label if this change will break existing games
- [ ] Add the `pins` or `archive_alpha_games` label if this change will break existing games
- [ ] Code passes linter with `docker compose exec rack rubocop -a`
- [ ] Tests pass cleanly with `docker compose exec rack rake`

### Implementation Notes
## Implementation Notes

* **Explanation of Change**
### Explanation of Change

* **Screenshots**
### Screenshots

* **Any Assumptions / Hacks**
### Any Assumptions / Hacks
7 changes: 5 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ on:
pull_request:
branches: [ master ]

env:
OPAL_PREFORK_DISABLE: "true"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.0
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.2
- name: Build and test with Rake
run: |
gem install bundler
Expand Down
11 changes: 10 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require: rubocop-performance

AllCops:
TargetRubyVersion: 3.0.2
TargetRubyVersion: 3.2
NewCops: enable
SuggestExtensions: false

Expand Down Expand Up @@ -74,6 +74,10 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Naming/BlockForwarding:
EnforcedStyle: explicit
BlockForwardingName: block

Naming/MemoizedInstanceVariableName:
Enabled: false

Expand Down Expand Up @@ -144,6 +148,11 @@ Style/HashEachMethods:
Style/HashLikeCase:
Enabled: false

Style/HashSyntax:
Enabled: true
EnforcedStyle: no_mixed_keys
EnforcedShorthandSyntax: never

Style/NegatedIfElseCondition:
Enabled: false

Expand Down
15 changes: 7 additions & 8 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ See [Developing on Windows](https://github.com/tobymao/18xx/wiki/Developing-For-

## Use a Github Codespace

If you would like a repeatable build environment, click the `Code` button in the repo, click `Codespace` then the `plus sign` button to create [a new Codespace](https://github.com/features/codespaces).
If you would like a repeatable build environment, click the `Code` button in the repo, click `Codespace` then the `plus sign` button to create [a new Codespace](https://github.com/features/codespaces).

![Screenshot 2022-11-13 10 09 46 AM](https://user-images.githubusercontent.com/1711810/201537600-294512b8-3a99-4762-8c16-d64294706434.png)

Expand Down Expand Up @@ -167,9 +167,9 @@ stackprof stackprof.dump

Once a game has been made available on the website, bugs may be found where the solutions requires breaking active gamestates due to missing or added required actions. If the action is known to always need removal, or the additional action needed able to be determined computationally, we can automate this fix. This assumes you have a fixture/json file locally you want to fix.

1. Update `repair` within `migrate_game.rb` with the logic required to add/delete a step
1. Update `repair` within `scripts/migrate_game.rb` with the logic required to add/delete a step
2. Run `docker-compose exec rack irb`
3. Execute `load "migrate_game.rb"`
3. Execute `load "scripts/migrate_game.rb"`
4. Execute `migrate_json('your_json_file.json')`

This will apply the migrations to the game file you specified, allowing you to verify it worked as expected.
Expand All @@ -179,19 +179,19 @@ This will apply the migrations to the game file you specified, allowing you to v
You may want example games in your development environment to test. One way to do this is to import games directly from the production website.

1. Run `docker-compose exec rack irb`
2. Execute `load "import_game.rb"`
2. Execute `load "scripts/import_game.rb"`
3. Execute `import_game(<product_game_id>)`

A copy of that game is now available locally.
A copy of that game is now available locally.

#### Pinning a game in your local test enviornment

You may want to pin a specific game in your local development environment. Pinning a game allows for breaking changes to be introduced while 'freezing' the existing game to a previous code commit version. Pinning is designed to work in production environments only, the following workaround can be applied to pin games in your local development environment.

1. Run `docker-compose exec rack irb`
2. Import all the dependcies that will allow you to run `Game` class. Alternativly you can run `load "import_game.rb"`
2. Import all the dependcies that will allow you to run `Game` class. Alternativly you can run `load "scripts/import_game.rb"`
3. Run `game = Game[id: <id of game you want to pin>]`
4. Run `game.settings['pin'] ='<sha of commit>'` . The sha should be of length 9 of the commit you want to pin to.
4. Run `game.settings['pin'] ='<sha of commit>'` . The sha should be of length 9 of the commit you want to pin to.
5. Run `game.save` to save the changes.

For the pin to work you need to generate the pin.js file. Doing so will break your development environment. Perform the following steps to generate the pin file and fix your development environment
Expand All @@ -200,4 +200,3 @@ For the pin to work you need to generate the pin.js file. Doing so will break yo
3. Restart your development environment server

Note: The precompile step creates a <pinned sha>.js.gzip in public/pinned. If you're still seeing js errors unzip the compressed file. You can run `gzip -d <pin>.js.gz>` to extract the js file

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1
FROM ruby:3.2

ARG RACK_ENV
RUN mkdir /18xx
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'message_bus'
gem 'mini_racer'
gem 'newrelic_rpm'
gem 'opal'
gem 'racc'
gem 'rake'
gem 'redis'
gem 'require_all'
Expand Down
24 changes: 13 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GEM
remote: https://rubygems.org/
specs:
argon2 (2.1.1)
ffi (~> 1.14)
argon2 (2.2.0)
ffi (~> 1.15)
ffi-compiler (~> 1.0)
ast (2.4.2)
byebug (11.1.3)
Expand All @@ -23,7 +23,7 @@ GEM
kgio (2.11.4)
libv8-node (16.10.0.0)
libv8-node (16.10.0.0-x86_64-linux)
listen (3.7.1)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
message_bus (4.2.0)
Expand All @@ -32,7 +32,7 @@ GEM
mini_racer (0.6.2)
libv8-node (~> 16.10.0.0)
newrelic_rpm (8.6.0)
opal (1.5.0)
opal (1.8.2)
ast (>= 2.3.0)
parser (~> 3.0, >= 3.0.3.2)
parallel (1.22.1)
Expand All @@ -41,24 +41,25 @@ GEM
parser (3.1.2.0)
ast (~> 2.4.1)
pg (1.3.5)
pry (0.13.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (~> 0.13.0)
pry (>= 0.13, < 0.15)
raabro (1.4.0)
rack (3.0.6.1)
racc (1.7.3)
rack (3.0.9.1)
rainbow (3.1.1)
raindrops (0.20.0)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.6.0)
regexp_parser (2.3.0)
require_all (3.0.0)
rerun (0.13.1)
rerun (0.14.0)
listen (~> 3.0)
rexml (3.2.5)
roda (3.55.0)
Expand Down Expand Up @@ -126,6 +127,7 @@ DEPENDENCIES
opal
parallel_tests
pry-byebug
racc
rake
redis
require_all
Expand All @@ -145,4 +147,4 @@ DEPENDENCIES
unicorn-worker-killer

BUNDLED WITH
2.3.7
2.4.10
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ prod_rack_up_b_d : prod_link data_dir ensure_prod_env
# remotely deploy latest master in prod
prod_deploy : clean
$(CONTAINER_COMPOSE) run rack rake precompile && \
rsync --verbose --checksum public/pinned/*.js.gz deploy@18xx:~/18xx/public/pinned/ && \
rsync --verbose --checksum public/assets/*.js public/assets/*.js.gz public/assets/version.json deploy@18xx:~/18xx/public/assets/ && \
ssh -l deploy 18xx "source ~/.profile && cd ~/18xx/ && git pull && make prod_rack_up_b_d"

Expand Down
Loading

0 comments on commit a8ac388

Please sign in to comment.