Commit Graph

142 Commits

Author SHA1 Message Date
san7890
616772574e Ensures that all Unit Tests are ticked in _unit_tests.dm (#76404)
## About The Pull Request

Ensures we don't get a repeat of #76345 (unit test that wasn't ticked in
the `_unit_tests.dm` file, fixed in
596ca8b6d4). Basically, we leverage the
code that was already being used in the DME Validator but then expand it
a bunch via using JSON Schemas that correspond to the type of scan we
want to run. Even though sorting unit tests alphabetically is a bit
different than sorting the tgstation DME, it's good to leverage the
already existing framework rather than create a copy-pasta "lesser" code
runner. This went through strenous testing on my end, so let me know if
anything seems off.

While in the area, I added some other niceties that I've found work
really well in GitHub Runners environments, as well as local testing in
case you really like doing that before you make a PR for some reason.
## Why It's Good For The Game


![image](https://github.com/tgstation/tgstation/assets/34697715/307161d7-cef1-418b-9a51-2a7bf6c5b678)

This is what it looks like pre-596ca8b6d4cc49cd69fc104b53b7f4973497a2e5
(this is now merged, so it will pass CI)

De-hardcodes some stuff and allows for some neater flexibility, less
cringe unit tests being coded and not being ticked in the file, etc.
etc.
## Changelog
Nothing for players to care about.

Let me know if you have a better idea than the schemas, I couldn't think
of one that could be really extensible and flexible in the same way this
is.
2023-06-30 14:16:37 +12:00
Jordan Dominion
44f88e49be Quietens Spaceman when debugging UNIT_TESTS locally (#75570)
The contract is removed by virtue of testing.
2023-05-30 01:21:55 +00:00
Wayland-Smithy
8cd0d05ee3 Update emoji remover workflow for node16 (#75434)
## About The Pull Request

Bumps the emoji remover action's commit hash +1 to [the current
one](de0c1d158e)
which has passed my node16 testing.
Necessary for when github intends to disable node12 later this year.

## Why It's Good For The Repo

Paying off some tech debt so the action continues to help maintain
maintainer sanity into 2024 and byond,

## Changelog
Non player/admin facing change.
2023-05-14 21:43:29 -06:00
Jordan Dominion
d699d8ce74 Improve PR wording so maintainers don't entirely gloss over DMAPI updates (#74796)
![image](https://user-images.githubusercontent.com/8171642/232563582-185b8f69-1273-4360-9e87-0964143c54e8.png)
2023-04-20 08:21:23 -07:00
san7890
78c10df5d2 Client Compatibility Check Actually Uses Our Fork (#74514)
## About The Pull Request

In #74364 (e0ac161029), we wanted to use
the fork for this action rather than MSO's version. However, we only
updated the changeover to the `tgstation` version in one location, not
all occurrences in our CI suite.

This PR cleans that up real fast.
2023-04-04 16:08:27 -07:00
Kyle Spier-Swenson
e0ac161029 Adds CI check to detect if byond starts requiring 515 clients before we want that (#74364)
todo: (i'm going to bed or i'd do them before opening the pr)
fork the action over to the org
~~make this more configurable as mothblocks requested~~
~~add this to the windows build and integration test steps (if it
generates a dmb, we gonna validate its got the expected value for client
compatibility)~~
~~test 515 client required fails.~~

https://github.com/MrStonedOne/byond-client-compatibility-check

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-04-04 08:30:00 -07:00
Mothblocks
f9d9555aaf Add test suite that just checks for if alternate tests pass so that we can require it instead of the specific tests (#74380)
Right now alternate tests cannot be changed without also changing the
specific name of the new alternate tests, and existing PRs will be
broken. This allows us to change the names without worry, as we mark
*this* as required. If the tests fail, this is skipped, which does not
count for a required test.
2023-03-31 19:46:54 -06:00
Lars Gohr
98c02c8454 Updated elgohr/Publish-Docker-Github-Action to a supported version (v5) (#74370)
elgohr/Publish-Docker-Github-Action@master is not supported anymore
2023-03-30 10:04:45 -07:00
san7890
ccef887efe Lints Against Unmanaged Local Defines (#74333)
# MAINTAINER - USE THE BUTTON THAT SAYS "MERGE MASTER" THEN SET THE PR
TO AUTO-MERGE! IT'S MUCH EASIER FOR ME TO FIX THINGS BEFORE THEY SKEW
RATHER THAN AFTER THE FACT.

## About The Pull Request

Hey there,

This took a while to do, but here's the gist:

Python file now regexes every file in `/code` except for those that have
some valid reason to be tacking on more global defines. Some of those
reasons are simply just that I don't have the time right now (doing what
you see in this PR took a few hours) to refactor and parse what should
belong and what should be thrown out. For the time being though, this PR
will at least _halt_ people making the mistake of not `#undef`ing any
files they `#define` "locally", or within the scope of a file.

Most people forget to do this and this leads to a lot of mess later on
due to how many variables can be unmanaged on the global level. I've
made this mistake, you've made this mistake, it's a common thing. Let's
automatically check for it so it can be fixed no-stress.

Scenarios this PR corrects:

* Forgetting to undef a define but undeffing others.
* Not undeffing any defines in your file.
* Earmarking a define as a "file local" define, but not defining it.
* Having a define be a "file local" define, but having it be used
elsewhere.
* Having a "local" define not even be in the file that it only shows up
in.
* Having a completely unused define*

(* I kept some of these because they seemed important... Others were
junked.)
## Why It's Good For The Game

If you wanna use it across multiple files, no reason to not make it a
global define (maybe there's a few reasons but let's assume that this is
the 95% case).

Let me know if you don't like how I re-arranged some of the defines and
how you'd rather see it be implemented, and I'd be happy to do that.
This was mostly just "eh does it need it or not" sorta stuff.

I used a pretty cool way to detect if we should use the standardized
GitHub "error" output, you can see the results of that here
https://github.com/san7890/bruhstation/actions/runs/4549766579/jobs/8022186846#step:7:792
## Changelog
Nothing that really concerns players.

(I fixed up all this stuff using vscode, no regexes beyond what you see
in the python script. sorry downstreams)
2023-03-29 10:17:03 -07:00
Jordan Dominion
b16b1a6120 Try fixing TGS test suite master build (#73787)
How tf do you get the SHA on push?
2023-03-06 20:37:25 -07:00
Mothblocks
486b569cb0 Fix 515 warnings from INVOKE_ASYNC and qdel experiment flag, treat warnings as errors in CI (#73788)
Fixes #72681
2023-03-05 23:37:11 -05:00
Jordan Dominion
8e5ed84157 Conditionally run TGS tests (#73704)
Also add test merge support for pull requests
2023-03-04 10:25:53 -08:00
MrMelbert
3f659dd9d3 Revert "Rat Trap" (#73539)
Reverts tgstation/tgstation#73159

Pretty sure this wasn't supposed to be merged, considering it disabled a
test, a workflow run, and implements an atom New override
2023-02-20 09:54:40 +13:00
LemonInTheDark
777b4dc367 Rat Trap (#73159) 2023-02-19 15:18:21 -05:00
san7890
363a92c8db Nukes The 2.5-Minute Long Artifact Upload on Windows Build (#73474) 2023-02-19 01:26:31 -05:00
Mothblocks
bb7231f436 Remove 515 compatibility test (#73380)
Don't need it anymore
2023-02-12 23:00:43 -08:00
Mothblocks
4011f17c7a Only cancel concurrent CI in the same PR (#73398)
More merge queue bullshit. Cancels are counted as failures, and even
though on my test branch it worked completely fine, when trying on two
real PRs, it did not.

This makes it so merges into master might mess with CI clogging again,
but also merge queue is going to do that on its own, and the gain is
worth it.


![image](https://user-images.githubusercontent.com/35135081/218340666-6f937611-c47e-4122-b4b8-b84e8edcc1e9.png)
2023-02-12 23:07:23 +00:00
Mothblocks
684963da97 Change always() to success() || failure() in CI (#73396)
Checking if this fixes merge queue. This ideally doesn't pass if CI is
cancelled, which is a requirement right now for merge queue to work
because reasons

Also:

![image](https://user-images.githubusercontent.com/35135081/218338953-96fa5b4e-fc07-4b3a-9ab5-f50a6772cd01.png)
2023-02-12 22:04:19 +00:00
Mothblocks
ec998bfe9b Add gh-readonly-queue to CI (#73381)
Makes merge queue work, this and the `merge_group` entry make everything
work good
2023-02-12 09:21:58 +00:00
Mothblocks
b535fd32e4 Add merge_group to CI suite (#73369)
Probably lets us use merge queue. I would be doing this on a fork but I
don't have access to the beta 🤷‍♀️

Pull request for the sake of downstreams but I intend on self merging
this (and my followup test PRs, though to another branch). Will start
with commit queue on my project branch.

Should be noted that I predict flaky tests might hit us harder, since it
might stop the entire queue? I'll see
2023-02-11 23:50:48 +00:00
Tastyfish
50a9d4c54d Maplint tool now has proper github action error messages (#72920)
## About The Pull Request

The tool added in #72372 is pretty awesome. The output is uhh cryptic
though. I had to read the source code to realize the (line 382) or
whatever part of the message was the dmm line number and there's stack
traces everywhere. I've made it support github action error messages so
now you get this beauty if you mess up:

![Example cable
error](https://user-images.githubusercontent.com/1185434/214156870-d73ffba0-f79a-43ed-9574-e74cc2ee2057.png)

Or, in the run summary:


![image](https://user-images.githubusercontent.com/1185434/214157201-e392a6d6-a8a8-4d8a-ac74-c65ae97438c8.png)

Errors parsing the lint yml's will also output github action errors,
although the line number will always be 1 since the yaml parser discards
line numbers to my knowledge.

In the midst of doing this, I made the error type contain the file and
line info, and added a bunch of type hints in the midst of trying to
understand Mothblock's code.

Note that for power users, the default behavior is still colored
terminal text; `--github` is added by the CI suite to enable this
behavior.
## Why It's Good For The Game

Much easier to see where the errors are and what they are (who even
knows what a 'pop' is? The tg game code calls them grid models.)
## Changelog
Nothing player-facing.
2023-01-28 18:56:24 -05:00
Mothblocks
6f07ae305b Replace nearly every map grep with a YML file that actually respects structure, and fixes the massive amount of failures that were never caught (#72372)
[Documentation
here](https://github.com/Mothblocks/tgstation/blob/maplint/tools/maplint/README.md)

We should not be using greps to the capacity that we currently are. If
you are not smarter than a parser, then you should not try to beat one.
DMM files should NOT be treated as text files that can be parsed with
any old Unix tool. They are a structured language. Because of our abuse
of greps, check_greps is full of hard to read, hard to maintain checks
that do not consistently work, because they all make very specific
assumptions about how TGM works, which are provably untrue.

This format is mostly straightforward for the lints people write, and
easily extensible to the ones people will want to write.

🆑
fix: Fixes a bunch of cases of windows not being where they were
supposed to be, tables/chairs stacking on each other, and other very
small stuff you've never noticed before.
/🆑
2023-01-03 21:21:37 -08:00
Mothblocks
00e60cc419 Pin autowiki to Ubuntu 20.04 (#71919)
Autowiki uses ubuntu-latest, which does not have the libssl version it
wants. GitHub recently increased these from 20.04 to 22.04. Yes this is
extremely can-kicking and we will have to fix our stuff to use 22.04
eventually I'm just tired
2022-12-12 12:56:30 +13:00
Mothblocks
4552de36fa Rerun flaky tests automatically, and create issue reports for them (#71519)
Adds a new workflow that will try to automatically detect and rerun
flaky tests, and create an issue report for them.

The detection mechanism is heuristic: if exactly ONE job fails in the CI
Suite, then it is assumed to be flaky, and will be rerun. If the next
run succeeds, then it will create an issue report for that flaky test if
one does not already exist. It will do its best to create a unique but
consistent identifier, aided by PRs like #71515. You can find an example
here: https://github.com/Mothblocks/ss13-workflow-testing/issues/20.
Maintainers can also rename the issue if they wish, it will still be
able to find it.

While there is a chance for this mechanism to go wrong and create bogus
issue reports, it IS possible to easily disable actions, I did it for
the stale one just a bit ago. Most likely, this mechanism going wrong is
going to be the result of randomness leaking in tests, like random human
names, so this can be solved in the tests themselves. I find it
extremely unlikely, but in the worst case scenario where this happens
often, we can add a way for maintainers to edit the issue report and
include a regex to match for runtimes. Just an idea.

Includes a few large-ish downloaded logs from past failures that are
interesting in unique ways. These are used for tests of the title
generator.
2022-11-30 16:50:13 +13:00
MrMelbert
50babecba3 Run CI, merge conflict checks, and 515 compat on "project branches" (#71601)
## About The Pull Request

Here introduces "project" branches. Branches designed for bit by bit
contributions of large scale refactors and changes. PRs to these
branches will show up on tracker like normal but won't apply to master
until the project branch itself is done and merged in. This allows for
much easier review and atomization without compromising master with
temporary hacky code.

A maintainer will create a project branch on the repository, allowing
any contributor to PR to it like normal. Very simple.

An example of this use can be seen in the basic bots PR. It is too large
to be full sent as one PR, but doing it one bot at a time will result in
a lot of bugs and copy and pasted code. This way, we can update bots one
by one until they're all done, then full send it.

This PR adjusts our CI (as well as merge conflict checks and 515
compatibility) to run on "`project/`" branches in addition to master.
2022-11-29 16:34:43 -08:00
Mothblocks
f607737ea4 Don't rerun "Show Screenshot Tests" (#71517)
I don't want the tool to rerun flaky tests to rerun show screenshot test
results, or else it will repeat the comment twice if it only fails on
one map.
2022-11-27 23:30:20 -08:00
Gamer025
63d91d7ab4 Only notify codeowners on non draft PRs (#71545)
## About The Pull Request
As requested by Mothblocks the codeowner action will now only parse PRs
that are not drafted.
This is done to align with Githubs default behavior of assigning
codeowners.

The workflow will now also run when a PR is marked as ready for review
(undrafted).
## Why It's Good For The Game
Annoys the codeowners less often
2022-11-27 23:01:16 -08:00
Mothblocks
171a3a5fc4 Remove cache purge key that has never worked and has meant that our cache has never worked (#71529)
ci_suite.yml runs on your fork. This means you do not have access to
secrets. Every user has had the purge key of blank.

WE have it set to something. Which means the master cache that every PR
pulls from has been unable to match.

This means our cache has been at the max limit all this time, constantly
clearing out old caches, and never reusing any.
2022-11-27 14:59:21 +01:00
san7890
9ce20a77c9 Caches Rust for Run Linters CI (#71487)
## About The Pull Request

Hey there,

It's on the tin, we just cache the whole Rust installation to use over
multiple workflows. Without this, it would take up to _five minutes per
linters workflow run_ to install the whole fucking rust toolchain/crate
dependencies (ref:
https://github.com/san7890/bruhstation/actions/runs/3536980337/jobs/5936542571
).

Now with the cache, it's now down to approximately one minute, thirty
seconds after it's able to pull a cached rust installation (ref:
https://github.com/san7890/bruhstation/actions/runs/3537002138/jobs/5936585526
). More than half is very good, and frees up valuable Github Runners
slots sooner!

I've also always seen linters as that rapid check to immediately call
you out whenever you screw up in a PR, and it taking four minutes sorta
lessens that immediate: "HEY, LISTEN!" aspect
2022-11-25 00:28:22 -08:00
Zephyr
1aded37cfc Changes check_grep to use ripgrep and reformats/cleans up the check_grep file (#71324)
## About The Pull Request

I fucked up the check_grep entry for docking ports.
default grep doesn't support newlines and so I need to use `pcregrep -M`

## Why It's Good For The Game

linters working good
## Changelog

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
2022-11-21 11:46:22 -08:00
Mothblocks
4405feb27f Lowers frequency of Docker Publish and Generate Documentation changes to lower throughput (#71294)
Docker Publish is now a nightly.

Generate Documentation now runs every 6 hours.

Both used to run every commit, and our CI is getting heavily
bottlenecked. Need to ease some stress.
2022-11-15 23:17:36 -08:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
Mothblocks
e75fa446c8 Add support for running tests on alternate versions (#71177)
Adds support for additional byond versions tests
2022-11-09 07:57:46 +01:00
Mothblocks
7a545fe19f Fix remove guide comments workflow on forks (#70930) 2022-10-30 20:21:23 +01:00
Mothblocks
acd034f967 Remove guide comments action (#70739)
Removes all default comments after a PR is opened (and only when it is opened).

Means that I can turn on the pr body merge option without keeping all the cruft
2022-10-30 01:46:48 -07:00
Mothblocks
526de475cb Give auto_changelog a GITHUB_TOKEN (#70835) 2022-10-28 10:57:09 +13:00
Mothblocks
07b81e48e4 Fix auto changelog being named auto labeler (#70833) 2022-10-27 16:36:51 -04:00
Mothblocks
8bb8ca9d67 Move auto changelog generation into its own workflow (#70652)
I wanted to move auto labeling into its own workflow, but realized that it and changelog generation were coupled. So I'm detaching that first, and then will work on auto labeling later. Includes general code for a changelog parser so that I can reuse it by that point.

GitHub actions are great for downstreams, as setting up a PHP server for the webhook is not trivial, compared to Existing and getting it for free. They are also much more straightforward to test and update than the webhook. I was able to verify this was working trivially with an empty repository.

Tested and working: Mothblocks/ss13-workflow-testing@0a2de4d
2022-10-27 16:52:32 +13:00
Tastyfish
f7db90f566 Updates GH actions to use GITHUB_OUTPUT (#70633) 2022-10-19 20:54:48 -04:00
Tastyfish
3b0f8ce892 Update github actions versions in the github workflows (#70463)
About The Pull Request

As you may have noticed from the warnings in CI runs, Github is depreciating Node 12 since support for it was dropped in April. This is largely remedied by just updating the github action versions to v3. The parameters we use haven't changed their behavior.

Note that multiple bespoke dependencies, such as yogstation13/DreamAnnotate haven't updated, so that might eventually break if Github completely drops Node 12.
Why It's Good For The Game

Compatibility with changes in Github Actions
Changelog

N/A
2022-10-14 11:32:59 +13:00
Tastyfish
871dd4fd9e Cancels the 4 initial CI tests if another commit is pushed to the same PR (#70490)
Stop the 4 initial CI tets if another commit is pushed to a PR
2022-10-14 09:15:43 +13:00
Mothblocks
6bbda8f8b1 Automatic bot that comments when your PR is test merged (#70297)
Every 30 minutes, comments on every PR that was test merged with the rounds it was test merged on, with links.

Only posts one comment, auto updates it.

Gets the information from https://bus.moth.fans/recent-test-merges.json, which caches every 10 minutes to not hit DB hard. External site needed because I don't want to jump through all the hoops for DB approval here. Source code is here: https://github.com/Mothblocks/mothbus/blob/main/src/routes/recent_test_merges.rs#L30

Might time out when merged as it's going to be looking at test merges from 200 rounds, but it'll be fine afterwards
2022-10-08 21:06:28 -07:00
Mothblocks
914e8396dc Changes compile_changelogs to use comfyoranges (#70152) 2022-09-28 14:41:27 +13:00
Mothblocks
0e891fb1dd Revert back to original, didn't mean to push to master 2022-09-26 14:17:38 -07:00
Mothblocks
5b65115091 3. Upgrade to checkout/@v3 2022-09-26 12:35:39 -07:00
Mothblocks
e11572ccc1 Don't persist credentials? 2022-09-26 12:34:45 -07:00
Mothblocks
c931f7784d Use COMFY_ORANGE_PAT as backup 2022-09-26 12:28:48 -07:00
Mothblocks
d2db001079 Add workflow_dispatch option to compile_changelogs action (#70148)
Lets us run it manually
2022-09-26 19:52:40 +01:00
Y0SH1M4S73R
4e6e1f090e [Ready for Review] Admin lua scripting (#65635)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-07-19 15:45:23 -07:00
Naveen
d124f8999c chore: Set permissions for GitHub actions (#67850)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-07-17 01:09:53 -07:00