Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into forest/biosuits
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Apr 24, 2024
2 parents 621c666 + dc9aa36 commit 7250a67
Show file tree
Hide file tree
Showing 464 changed files with 28,225 additions and 16,506 deletions.
158 changes: 88 additions & 70 deletions .github/add_labels.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import os, re
from github import Github
from github import Github, GithubException

# Format - Key: Array[Label, [StringsToIgnore]]
changelogToPrefix = {
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'soundadd': ["Sound", ["added a new sound thingy"]],
'sounddel': ["Sound", ["removed an old sound thingy"]],
'imageadd': ["Sprites", ["added some icons and images"]],
Expand All @@ -24,78 +24,96 @@
}

fileToPrefix = {
'wav': 'Sound',
'ogg': 'Sound',
'wav': 'Sound',
'ogg': 'Sound',
'mp3': 'Sound', ## Can't believe they forgot about the best sound format
'dmm': 'Mapping',
'dmm': 'Mapping',

'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',
'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',

'dmi': "Sprites",
'dmi': "Sprites",
}

githubLabel = "Github"
missingLogLabel = "Missing Changelog"

def get_labels(pr):
labels = {}

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
return labels
lines = changelog_match.group(1).split('\n')
for line in lines:
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix:
continue

if content in changelogToPrefix[key][1]:
continue

labels[changelogToPrefix[key][0]] = True

return list(labels)
labels = {}
failed = False

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
print("::warning ::No changelog detected.")
labels[missingLogLabel] = True
return labels, False

lines = changelog_match.group(1).split('\n')
failed = len(lines) <= 2 # Make sure its not an empty changelog
if failed:
print("::error ::Empty changelog.")

for line in lines[1:-1]: # Skip first line with authors and last
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix: # Some key that we didn't expect
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

if content in changelogToPrefix[key][1]: # They left the template entry in
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

labels[changelogToPrefix[key][0]] = True

return list(labels), failed

def main():
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])

pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("Not a PR.")
return
pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("::warning ::Not a PR.")
return

labels = get_labels(pr)
labels, failed = get_labels(pr)

if labels is None: # no labels to add
print("No labels to add.")
return
if not missingLogLabel in labels:
try:
pr.remove_from_labels(missingLogLabel)
except GithubException as e:
if e.status == 404:
pass # 404 if we try to remove a label that isn't set

for label in labels:
pr.add_to_labels(label)
for label in labels:
pr.add_to_labels(label)

if failed:
exit(1)

if __name__ == '__main__':
main()
main()
2 changes: 0 additions & 2 deletions .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
# Format is version: map
# Example:
# 500.1337: runtimestation

515.1630: lv624
30 changes: 8 additions & 22 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,16 @@ jobs:

odlint:
name: Lint with OpenDream
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get OpenDream Version
run: |
source dependencies.sh
echo "OPENDREAM_VERSION=$OPENDREAM_VERSION" >> $GITHUB_ENV
- name: Restore OpenDream cache
uses: actions/cache@v3
id: cache-od
- uses: actions/checkout@v4
- uses: robinraju/[email protected]
with:
path: ~/OpenDream
key: ${{ runner.os }}-opendream-${{ env.OPENDREAM_VERSION }}
- name: Download OpenDream
if: steps.cache-od.outputs.cache-hit != 'true'
run: |
bash tools/ci/download_od.sh
- name: Setup OpenDream
if: steps.cache-od.outputs.cache-hit != 'true'
run: |
bash tools/ci/setup_od.sh
- name: Run OpenDream
run: |
bash tools/ci/run_od.sh
repository: "OpenDreamProject/OpenDream"
tag: "latest"
fileName: "DMCompiler_linux-x64.tar.gz"
extract: true
- run: ./DMCompiler_linux-x64/DMCompiler --suppress-unimplemented colonialmarines.dme

compile_all_maps:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Labeling
name: Labeling and Verification
on:
pull_request_target:
types: [opened]
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
Expand All @@ -13,7 +13,7 @@ jobs:
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "::set-output name=ACTIONS_ENABLED::$SECRET_EXISTS"
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Get The Script
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pygithub
sudo apt-get install dos2unix
- name: Add Labels
- name: Add and verify labels
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
python add_labels.py
Expand Down
2 changes: 1 addition & 1 deletion .tgs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
byond: "514.1588"
byond: "515.1627"
static_files:
- name: config
- name: data
Expand Down
7 changes: 6 additions & 1 deletion code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// High Command, can read the deletion log.
#define ARES_ACCESS_HIGH 9
#define ARES_ACCESS_WY_COMMAND 10
/// Debugging. Allows me to view everything without using a high command rank. Unlikely to stay in a full merge.
/// Debugging. Allows me to view everything without using a high command rank.
#define ARES_ACCESS_DEBUG 11

#define ARES_RECORD_ANNOUNCE "Announcement Record"
Expand All @@ -28,6 +28,7 @@
#define ARES_RECORD_MAINTENANCE "Maintenance Ticket"
#define ARES_RECORD_ACCESS "Access Ticket"
#define ARES_RECORD_FLIGHT "Flight Record"
#define ARES_RECORD_TECH "Tech Control Record"

/// Not by ARES logged through marine_announcement()
#define ARES_LOG_NONE 0
Expand Down Expand Up @@ -77,3 +78,7 @@
/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
#define COOLDOWN_ARES_VENT 60 SECONDS

/// Time until someone can respawn as Working Joe
#define JOE_JOIN_DEAD_TIME (15 MINUTES)
2 changes: 2 additions & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SEE_INVISIBLE_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.
#define INVISIBILITY_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.

#define HIDE_INVISIBLE_OBSERVER 59 // define for when we want to hide all observer mobs.

#define INVISIBILITY_OBSERVER 60
#define SEE_INVISIBLE_OBSERVER 60

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/__spacemandmm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
/world/Del()
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (debug_server)
LIBCALL(debug_server, "auxtools_shutdown")()
call_ext(debug_server, "auxtools_shutdown")()
. = ..()
9 changes: 0 additions & 9 deletions code/__DEFINES/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@

#define subtypesof(A) (typesof(A) - A)

#ifdef EXPERIMENT_515_DONT_CACHE_REF
/// Takes a datum as input, returns its ref string
#define text_ref(datum) ref(datum)
#else
/// Takes a datum as input, returns its ref string, or a cached version of it
/// This allows us to cache \ref creation, which ensures it'll only ever happen once per datum, saving string tree time
/// It is slightly less optimal then a []'d datum, but the cost is massively outweighed by the potential savings
/// It will only work for datums mind, for datum reasons
/// : because of the embedded typecheck
#define text_ref(datum) (isdatum(datum) ? (datum:cached_ref ||= "\ref[datum]") : ("\ref[datum]"))
#endif

#define addToListNoDupe(L, index) if(L) L[index] = null; else L = list(index)

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define CAMERA_NET_VEHICLE "Vehicle"
#define CAMERA_NET_LANDING_ZONES "Landing Zones"
#define CAMERA_NET_LASER_TARGETS "Laser Targets"
#define CAMERA_NET_CORRESPONDENT "Combat Correspondent Live"

#define CAMERA_NET_POWER_ALARMS "Power Alarms"
#define CAMERA_NET_ATMOSPHERE_ALARMS "Atmosphere Alarms"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define MESSAGE_TYPE_ADMINLOG "adminlog"
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
#define MESSAGE_TYPE_DEBUG "debug"
#define MESSAGE_TYPE_NICHE "niche"

/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#define COMSIG_ITEM_PICKUP "item_pickup"

///from /obj/item/device/camera/broadcasting/attack_self
#define COMSIG_BROADCAST_GO_LIVE "broadcast_live"

/// from /obj/item/proc/mob_can_equip
#define COMSIG_ITEM_ATTEMPTING_EQUIP "item_attempting_equip"
///Return this in response if you don't want items equipped
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
/// from /obj/structure/transmitter/update_icon()
#define COMSIG_TRANSMITTER_UPDATE_ICON "transmitter_update_icon"

#define COMSIG_STRUCTURE_WRENCHED "structure_wrenched"
#define COMSIG_STRUCTURE_UNWRENCHED "structure_unwrenched"
#define COMSIG_TENT_COLLAPSING "tent_collapsing"

/// from /obj/proc/afterbuckle()
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@

#define COMSIG_GLOB_HIJACK_IMPACTED "!hijack_impacted"
#define COMSIG_GLOB_HIJACK_LANDED "!hijack_landed"

/// From /datum/controller/subsystem/hijack/fire()
#define COMSIG_GLOB_FUEL_PUMP_UPDATE "!fuel_pump_update"
2 changes: 2 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
#define ANIMATED_SURGICAL_TOOL (1<<12)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<13)
/// Overrides NODROP in some cases (stripping)
#define FORCEDROP_CONDITIONAL (1<<14)
//==========================================================================================


Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@
#define EMOTE_IMPORTANT (1<<2)
/// Does the emote not have a message?
#define EMOTE_NO_MESSAGE (1<<3)

// Bitflags for Working Joe emotes
/// Working Joe emote
#define WORKING_JOE_EMOTE (1<<0)
/// Hazard Joe emote
#define HAZARD_JOE_EMOTE (1<<1)
1 change: 1 addition & 0 deletions code/__DEFINES/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
#define SYNTH_COMBAT "Combat Synthetic"
#define SYNTH_INFILTRATOR "Infiltrator Synthetic"
#define SYNTH_WORKING_JOE "Working Joe"
#define SYNTH_HAZARD_JOE "Hazard Joe"
#define SYNTH_GEN_ONE "First Generation Synthetic"
#define SYNTH_GEN_TWO "Second Generation Synthetic"
#define SYNTH_GEN_THREE "Third Generation Synthetic"
Expand Down
Loading

0 comments on commit 7250a67

Please sign in to comment.