Skip to content

Commit

Permalink
Merge branch 'recipes-galore' of https://github.com/dwasint/Monkestat…
Browse files Browse the repository at this point in the history
…ion2.0 into recipes-galore
  • Loading branch information
dwasint committed Sep 24, 2024
2 parents 750907d + ac99b53 commit 331d736
Show file tree
Hide file tree
Showing 67 changed files with 900 additions and 267 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: github-actions
directory: /
target-branch: master
schedule:
interval: daily
labels:
- GitHub
open-pull-requests-limit: 10
47 changes: 27 additions & 20 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ concurrency:
cancel-in-progress: true

jobs:
run_linters:
start_gate:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Start Gate
runs-on: ubuntu-latest
steps:
- name: Mandatory Empty Step
run: exit 0

run_linters:
name: Run Linters
needs: start_gate
runs-on: ubuntu-22.04
timeout-minutes: 5

Expand Down Expand Up @@ -122,9 +130,8 @@ jobs:
run: tools/build/build --ci lint tgui-test

compile_all_maps:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Compile Maps
needs: [collect_data]
needs: collect_data
runs-on: ubuntu-22.04
timeout-minutes: 5

Expand All @@ -147,8 +154,8 @@ jobs:
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}

collect_data:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Collect data for other tasks
needs: start_gate
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
Expand Down Expand Up @@ -177,9 +184,8 @@ jobs:
echo "max_required_byond_client=$(grep -Ev '^[[:blank:]]{0,}#{1,}|^[[:blank:]]{0,}$' .github/max_required_byond_client.txt | tail -n1)" >> $GITHUB_OUTPUT
run_all_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Integration Tests
needs: [collect_data]
needs: collect_data

strategy:
fail-fast: false
Expand All @@ -192,9 +198,9 @@ jobs:
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

run_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
if: needs.collect_data.outputs.alternate_tests != '[]'
name: Alternate Tests
needs: [collect_data]
needs: collect_data
strategy:
fail-fast: false
matrix:
Expand All @@ -207,18 +213,9 @@ jobs:
minor: ${{ matrix.setup.minor }}
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

check_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
name: Check Alternate Tests
needs: [run_alternate_tests]
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- run: echo Alternate tests passed.

compare_screenshots:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && (success() || failure()) )
needs: [run_all_tests, run_alternate_tests]
if: needs.collect_data.outputs.alternate_tests == '[]' || needs.run_alternate_tests.result == 'success'
needs: [ collect_data, run_all_tests, run_alternate_tests ]
name: Compare Screenshot Tests
timeout-minutes: 15
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -255,7 +252,6 @@ jobs:
path: artifacts/screenshot_comparisons

test_windows:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Windows Build
needs: [collect_data]
runs-on: windows-latest
Expand All @@ -279,3 +275,14 @@ jobs:
with:
dmb-location: tgstation.dmb
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}

completion_gate: # Serves as a non-moving target for branch rulesets
if: always() && !cancelled()
name: Completion Gate
needs: [ test_windows, compare_screenshots, compile_all_maps, run_linters ]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
3 changes: 2 additions & 1 deletion .github/workflows/update_tgs_dmapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Apply DMAPI update
uses: tgstation/tgs-dmapi-updater@v2
id: dmapi-update
with:
header-path: 'code/__DEFINES/tgs.dm'
library-path: 'code/modules/tgs'
Expand All @@ -41,7 +42,7 @@ jobs:
source_branch: "tgs-dmapi-update"
destination_branch: "master"
pr_title: "Automatic TGS DMAPI Update"
pr_body: "This pull request updates the TGS DMAPI to the latest version. Please note any changes that may be breaking or unimplemented in your codebase by checking what changes are in the definitions file: code/__DEFINES/tgs.dm before merging."
pr_body: "This pull request updates the TGS DMAPI to the latest version. Please note any changes that may be breaking or unimplemented in your codebase by checking what changes are in the definitions file: code/__DEFINES/tgs.dm before merging.\n\n${{ steps.dmapi-update.outputs.release-notes }}"
pr_label: "Tools"
pr_allow_empty: false
github_token: ${{ secrets.COMFY_ORANGE_PAT || secrets.GITHUB_TOKEN }}
70 changes: 67 additions & 3 deletions SQL/database_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,83 @@ Any time you make a change to the schema files, remember to increment the databa

Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be found in `code/__DEFINES/subsystem.dm`.

The latest database version is 5.24; The query to update the schema revision table is:
The latest database version is 5.26; The query to update the schema revision table is:

```sql
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 25);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 26);
```
or

```sql
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 25);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 26);
```

In any query remember to add a prefix to the table names if you use one.

-----------------------------------------------------
Version 5.26, 20 September 2024, by Absolucy
Properly added the previously undocumented `metric_data`, `subsystem_metrics`, `subsystem_extra_metrics`, `overwatch_whitelist`, and `overwatch_asn_ban` tables.
```sql
CREATE TABLE `metric_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`cpu` decimal(20,10) unsigned DEFAULT NULL,
`maptick` decimal(20,10) unsigned DEFAULT NULL,
`elapsed_processed` int(15) unsigned DEFAULT NULL,
`elapsed_real` int(15) unsigned DEFAULT NULL,
`client_count` int(15) unsigned DEFAULT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`relational_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `overwatch_asn_ban` (
`ip` varchar(21) NOT NULL,
`asn` varchar(100) NOT NULL,
`a_ckey` varchar(30) NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`asn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `overwatch_ip_cache` (
`ip` varchar(50) NOT NULL DEFAULT '',
`response` longtext NOT NULL,
PRIMARY KEY (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `overwatch_whitelist` (
`ckey` varchar(30) NOT NULL,
`a_ckey` varchar(30) NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `subsystem_extra_metrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`ss_id` varchar(255) DEFAULT NULL,
`relation_id_SS` varchar(255) DEFAULT NULL,
`ss_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
CONSTRAINT `ss_value` CHECK (json_valid(`ss_value`))
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `subsystem_metrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`avg_iter_count` decimal(20,6) NOT NULL DEFAULT 0.000000,
`avg_drift` decimal(20,6) NOT NULL DEFAULT 0.000000,
`datetime` datetime NOT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`ss_id` varchar(255) DEFAULT NULL,
`relational_id` varchar(255) DEFAULT NULL,
`relation_id_SS` varchar(255) DEFAULT NULL,
`cost` decimal(20,6) unsigned DEFAULT NULL,
`tick_usage` decimal(20,6) unsigned DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
```

-----------------------------------------------------
Version 5.25, 8 September 2024, by Absolucy
Added `log_directory` field to the `round` table.
Expand Down
86 changes: 86 additions & 0 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,9 @@ CREATE TABLE `telemetry_connections` (
UNIQUE INDEX `unique_constraints` (`ckey` , `telemetry_ckey` , `address` , `computer_id`)
);

--
-- Table structure for table `tutorial_completions`
--
DROP TABLE IF EXISTS `tutorial_completions`;
CREATE TABLE `tutorial_completions` (
`id` INT NOT NULL AUTO_INCREMENT,
Expand All @@ -716,6 +719,89 @@ CREATE TABLE `tutorial_completions` (
PRIMARY KEY (`id`),
UNIQUE INDEX `ckey_tutorial_unique` (`ckey`, `tutorial_key`));

--
-- Table structure for table `metric_data`
--
DROP TABLE IF EXISTS `metric_data`;
CREATE TABLE `metric_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`cpu` decimal(20,10) unsigned DEFAULT NULL,
`maptick` decimal(20,10) unsigned DEFAULT NULL,
`elapsed_processed` int(15) unsigned DEFAULT NULL,
`elapsed_real` int(15) unsigned DEFAULT NULL,
`client_count` int(15) unsigned DEFAULT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`relational_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `overwatch_asn_ban`
--
DROP TABLE IF EXISTS `overwatch_asn_ban`;
CREATE TABLE `overwatch_asn_ban` (
`ip` varchar(21) NOT NULL,
`asn` varchar(100) NOT NULL,
`a_ckey` varchar(30) NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`asn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Table structure for table `overwatch_ip_cache`
--
DROP TABLE IF EXISTS `overwatch_ip_cache`;
CREATE TABLE `overwatch_ip_cache` (
`ip` varchar(50) NOT NULL DEFAULT '',
`response` longtext NOT NULL,
PRIMARY KEY (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Table structure for table `overwatch_whitelist`
--
DROP TABLE IF EXISTS `overwatch_whitelist`;
CREATE TABLE `overwatch_whitelist` (
`ckey` varchar(30) NOT NULL,
`a_ckey` varchar(30) NOT NULL,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Table structure for table `subsystem_extra_metrics`
--
DROP TABLE IF EXISTS `subsystem_extra_metrics`;
CREATE TABLE `subsystem_extra_metrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`ss_id` varchar(255) DEFAULT NULL,
`relation_id_SS` varchar(255) DEFAULT NULL,
`ss_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
CONSTRAINT `ss_value` CHECK (json_valid(`ss_value`))
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `metric_data`
--
DROP TABLE IF EXISTS `subsystem_metrics`;
CREATE TABLE `subsystem_metrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`avg_iter_count` decimal(20,6) NOT NULL DEFAULT 0.000000,
`avg_drift` decimal(20,6) NOT NULL DEFAULT 0.000000,
`datetime` datetime NOT NULL,
`round_id` int(15) unsigned DEFAULT NULL,
`ss_id` varchar(255) DEFAULT NULL,
`relational_id` varchar(255) DEFAULT NULL,
`relation_id_SS` varchar(255) DEFAULT NULL,
`cost` decimal(20,6) unsigned DEFAULT NULL,
`tick_usage` decimal(20,6) unsigned DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* make sure you add an update to the schema_version stable in the db changelog
*/
#define DB_MINOR_VERSION 25
#define DB_MINOR_VERSION 26 // monkestation edit: we've added plenty of our own tables to the db


//! ## Timing subsystem
Expand Down Expand Up @@ -353,3 +353,5 @@
#define SSLIQUIDS_RUN_TYPE_OCEAN 6
#define SSLIQUIDS_RUN_TYPE_TEMPERATURE 7
#define SSLIQUIDS_RUN_TYPE_CACHED_EDGES 8

#define ENQUEUE_SANITY 10000
1 change: 1 addition & 0 deletions code/__DEFINES/~monkestation/logging.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#define LOG_CATEGORY_GAME_LOOC "game-looc"
#define LOG_CATEGORY_STORYTELLER "storyteller"
#define LOG_CATEGORY_ENQUEUE "enqueue"
1 change: 1 addition & 0 deletions code/__DEFINES/~monkestation/maths.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define RELATIVE_ERROR(actual, expected) (abs(actual - expected) / expected)
3 changes: 3 additions & 0 deletions code/__HELPERS/logging/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@
logger.Log(LOG_CATEGORY_RUNTIME, text, data)
#endif
SEND_TEXT(world.log, text)

/proc/log_enqueue(text, list/data)
logger.Log(LOG_CATEGORY_ENQUEUE, text, data)
18 changes: 18 additions & 0 deletions code/controllers/configuration/entries/monkestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,21 @@
/datum/config_entry/flag/disable_particle_weather

/datum/config_entry/flag/disable_storyteller

/datum/config_entry/number/transfer_vote_time
default = 90 MINUTES
min_val = 0

/datum/config_entry/number/transfer_vote_time/ValidateAndSet(str_val)
. = ..()
if(.)
config_entry_value *= 600 // documented as minutes

/datum/config_entry/number/subsequent_transfer_vote_time
default = 30 MINUTES
min_val = 0

/datum/config_entry/number/subsequent_transfer_vote_time/ValidateAndSet(str_val)
. = ..()
if(.)
config_entry_value *= 600 // documented as minutes
Loading

0 comments on commit 331d736

Please sign in to comment.