Commit Graph

6 Commits

Author SHA1 Message Date
Karl Ostmo
d749c5e473
Upload and parse scenarios (#1798)
Towards #1797

Hosts an online repository of scenarios, against which solutions may be submitted.  This is the foundational layer that may support more structured "tournaments", scenario ranking, or other social activity.

# Demo

## Live server

http://swarmgame.net/list-games.html

One can use the [`submit.sh`](https://github.com/swarm-game/swarm/pull/1798/files#diff-450877e3442a0ec1c5cbe964808a263d67f1e680d3aa3c3bf9ae6f51eca682fb) script and see valid uploads reflected live on the website.

## Local testing

### Automated tests

These are database-agnostic.

    scripts/run-tests.sh swarm:test:tournament-host

### Manual tests

These test database interactions.  It requires first setting up a local Postgres server.

1. Start `tournament/scripts/demo/server-native.sh` in one console
2. Run `tournament/scripts/demo/client/test-cases/local/good-submit.sh` in another

# Features

* Upload and validates scenarios
* Download scenarios with solution redacted
* Submit, validate, execute, and score solutions

# Key components

* Servant server
* Hosted on AWS in a Docker container
* Stores to a Postgres database in Amazon RDS
* Shares some code with the integration tests for evaluating scenarios and solutions

The production database uses IAM to manage logins.  The web app uses the AWS API to fetch a "token" which can be used to log in instead of a password.  This avoids having to store a password on the server.

# TODO
- [ ] User authentication (GitHub OpenID?)
2024-04-25 20:11:11 +00:00
Karl Ostmo
346f960085
more partial function bans (#1564)
Towards #1494.

Replaced/restricted uses of `Prelude.tail` and `Prelude.!!`.  Quarantined `undefined`.

Introduced a new function `listEnumsNonempty` that is guaranteed safe.
2023-10-02 03:13:20 +00:00
Karl Ostmo
0c311b4323
Replace/quarantine uses of head and NE.fromList functions (#1503)
Towards #1494

* Totally eliminates partial `head`
* introduces an hlint rule to ban unsafe use of `head`
* restricts use of the partial `fromList` from `NonEmpty`
2023-09-10 12:03:56 +00:00
Karl Ostmo
a089bfac7d
prefer dots over dollars (#1190)
See [this comment](https://github.com/swarm-game/swarm/pull/974#discussion_r1112381178).
2023-04-02 20:24:03 +00:00
Ondřej Šebek
8652440607
Make GHC2021 extensions default (#520)
- closes #419
2022-07-01 09:07:41 +00:00
Brent Yorgey
369c0c6abc add a .hlint.yaml
For now, ignore the "Use if" hint.
2021-08-27 22:30:31 -05:00