10 Commits

Author SHA1 Message Date
SyncIt21 2c76673f70 Updates Biome & Prettier with linting applied (#96394)
## About The Pull Request
- Update Biome to 2.4.16
- Update prettier to 3.8.3
- Apply biome linting rules to a bunch of files
- Convert some files from common-js to es module

## Changelog
N/A
2026-06-10 09:08:43 +12:00
SyncIt21 6f4914aa76 Labeller action can remove labels from PR upon sync (#96131)
## About The Pull Request
#92553 made it possible for the PR author to add labels to the PR body
whenever it was updated however as discussed in the comments it was not
possible to remove labels.

Maintainers can still add/remove labels and that works as expected but
the PR author could not. This obviously is inconvenient and should not
be the case but now it is possible.

This will not conflict with maintainer added/removed labels which means
if the author says like removes the balance label from their changelog,
but the maintainer adds the balance label then the balance label will
always stay and cannot be removed by the author so labelling still works
as intended.

It will only remove labels added by the contributor should they decide
to change their changelog/modified files/PR title at any point

## Changelog
N/A

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2026-06-07 22:39:18 -07:00
Bloop 2075a27dc6 Makes the regex for the 'fix' label detection a bit more lenient (#93008)
## About The Pull Request

Currently, for detecting issue-closing fixes, the labeler regex matches
strictly things like:

`Fixes #some_number_here`

but sometimes people will paste the full issues url, which github
renders as the issue number. Problem is the raw text still has the url,
so it will not match when passed through the rest api.

This PR just makes it a bit less restrictive, so that something like
this:

``Fixes https://github.com/tgstation/tgstation/issues/some_number_here`

will correctly get registered as a fix.

## Why It's Good For The Game

More PRs getting autolabeled more correctly

## Changelog

Not player-facing
2025-09-17 20:43:39 -07:00
Bloop 128350e623 Fix for the labeler's management of maintainer added labels (#92676) 2025-08-26 22:56:10 -06:00
Bloop f3b20a5515 [No GBP] Makes sure the labeler can't readd labels that were explicitly removed by maintainers (#92614) 2025-08-19 22:50:59 -06:00
Bloop 458e0b1470 Allows labeler action to add/remove labels from the PR title/body on sync (#92553)
## About The Pull Request

Followup to https://github.com/tgstation/tgstation/pull/92504

Removes the conditional that was stopping the labeler from checking the
PR body for labels on sync.

<details><summary>No more of this weirdness</summary>

<img width="877" height="488" alt="firefox_zppJmK5qz2"
src="https://github.com/user-attachments/assets/74a556b5-a3e3-40e7-93dd-e18c62ed9649"
/>

</details>

Any time someone updates a PR and it syncs, you can potentially lose
some of the PR labels from the body (the changelog specifically) if they
are not configured as `add_only` in the autoLabelConfig.js

I had kept it in previously since it was how it was before, but thinking
on it I do not think this is even necessary anymore now that the php
webhook method is replaced with the action. Let's remove it!

## Why It's Good For The Game

QoL for maintainers and contributors

## Changelog

Nothing player-facing
2025-08-15 16:56:59 -06:00
Bloop 52107b29a0 Redoes the labeler action js backend (#92504)
## About The Pull Request

Redoes the labeler script to work for private or restricted repositories
(both of which need an auth token for using the REST api).

Previous version used `fetch()`, and checked the line diffs which was
inefficient and unnecessary. You only really need to be checking the
filenames when it comes to the diffs.

Now it uses
[octokit.rest.pulls.listFiles](https://octokit.github.io/rest.js/v20/#pulls-list-files)
and pagination. This version is faster and can support a larger amount
of diffs, up to 3000 files changed, and plays nicely with auth tokens
for private or restricted repos. Hooray! Tested the various functions of
it & things should work same as before.

<img width="591" height="171" alt="image"
src="https://github.com/user-attachments/assets/15ff75e2-0335-4b18-b6d7-3aefb312d173"
/>

Also adds support for matching file extensions, so it can find .dmm and
.dmis that might be in directories that do not start with `_maps/` or
`icons/`.

Thanks to @Kocma-san for doing a large part of this and helping figure
out what the issue was.

## Changelog

Not player-facing
2025-08-12 18:37:20 -04:00
Jeremiah 8757460daf [tgui] Linter fixes 1 (#91951)
## About The Pull Request
Atomized PR from converting us to biome. This converts all cases where
we're using `let` but it's never reassigned. This is considered a safe
fix
https://biomejs.dev/linter/rules/use-const/

## Command
Get [Biome](https://biomejs.dev/guides/manual-installation/) (the
executable, at least)
`biome lint --write --only "useConst"`


## Why It's Good For The Game
Moving us to a simple linter/formatter and shaving off a number of
packages, tech debt
## Changelog
Should be absolutely zero effect on gameplay
2025-07-06 22:10:21 +02:00
Jeremiah 9db2f6916b Sets prettier to run on the repo (#91379)
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
2025-05-29 21:23:59 -07:00
MrMelbert a6e33ed6ac Moves PR Labeling from webhook processor to Github actions (#89190)
## About The Pull Request

Strips auto-labeling behavior from the webhook processor to an action.
All that remains in the webhook processor is ingame PR announcements,
"changelog validation" (which is either broken or we have disabled), and
handling for "request review" (which we have disabled)

Keywords have been maintained 1:1, unless I missed something or
accidentally shoved something where it shouldn't be

I wanted to link this to the changelog parser but that seems like a
slightly larger project so I'll just throw this up as-is

Note: I'm not very experienced in writing actions so review with
scrutiny

## Why

Actions are a lot easier to maintain and set up for downstreams

Adding new labels should now be like, 10x easier since all you need to
do is slap it in the config file

Webhook processor is also kinda old an breaks semi-frequently

### (Tested)


![image](https://github.com/user-attachments/assets/7fe50ca7-3b18-4d6c-abcf-58c9195380bd)


![image](https://github.com/user-attachments/assets/c1643a27-27c6-420e-b6e5-355a450b0ab3)
2025-01-27 20:53:31 -07:00