mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 01:49:19 +00:00
update this!
This commit is contained in:
@@ -39,9 +39,9 @@
|
||||
#include "chain_pull_through_space.dm"
|
||||
// #include "combat.dm"
|
||||
#include "component_tests.dm"
|
||||
#include "confusion.dm"
|
||||
// #include "confusion.dm"
|
||||
// #include "emoting.dm"
|
||||
#include "heretic_knowledge.dm"
|
||||
// #include "heretic_knowledge.dm"
|
||||
// #include "holidays.dm"
|
||||
#include "initialize_sanity.dm"
|
||||
#include "keybinding_init.dm"
|
||||
@@ -54,7 +54,7 @@
|
||||
// #include "plantgrowth_tests.dm"
|
||||
// #include "projectiles.dm"
|
||||
#include "reagent_id_typos.dm"
|
||||
#include "reagent_mod_expose.dm"
|
||||
// #include "reagent_mod_expose.dm"
|
||||
// #include "reagent_mod_procs.dm"
|
||||
#include "reagent_recipe_collisions.dm"
|
||||
#include "resist.dm"
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* For documentation on the changelog generator see https://tgstation13.org/phpBB/viewtopic.php?f=5&t=5157
|
||||
* To hide prs from being announced in game, place a [s] in front of the title
|
||||
* All runtime errors are echo'ed to the webhook's logs in github
|
||||
* Events to be sent via GitHub webhook: Pull Requests, Pushes
|
||||
* Any other Event will result in a 404 returned to the webhook.
|
||||
*/
|
||||
|
||||
/**CREDITS:
|
||||
@@ -23,6 +25,7 @@ define('F_UNVALIDATED_USER', 1<<0);
|
||||
define('F_SECRET_PR', 1<<1);
|
||||
|
||||
//CONFIGS ARE IN SECRET.PHP, THESE ARE JUST DEFAULTS!
|
||||
|
||||
$hookSecret = '08ajh0qj93209qj90jfq932j32r';
|
||||
$apiKey = '209ab8d879c0f987d06a09b9d879c0f987d06a09b9d8787d0a089c';
|
||||
$repoOwnerAndName = "tgstation/tgstation";
|
||||
@@ -32,7 +35,7 @@ $path_to_script = 'tools/WebhookProcessor/github_webhook_processor.php';
|
||||
$tracked_branch = "master";
|
||||
$trackPRBalance = true;
|
||||
$prBalanceJson = '';
|
||||
$startingPRBalance = 5;
|
||||
$startingPRBalance = 30;
|
||||
$maintainer_team_id = 133041;
|
||||
$validation = "org";
|
||||
$validation_count = 1;
|
||||
@@ -248,7 +251,7 @@ function tag_pr($payload, $opened) {
|
||||
$tags[] = 'Merge Conflict';
|
||||
|
||||
$treetags = array('_maps' => 'Map Edit', 'tools' => 'Tools', 'SQL' => 'SQL', '.github' => 'GitHub');
|
||||
$addonlytags = array('icons' => 'Sprites', 'sound' => 'Sound', 'config' => 'Config Update', 'code/controllers/configuration/entries' => 'Config Update', 'tgui' => 'UI');
|
||||
$addonlytags = array('icons' => 'Sprites', 'sound' => 'Sound', 'config' => 'Config Update', 'code/controllers/configuration/entries' => 'Config Update', 'code/modules/unit_tests' => 'Unit Tests', 'tgui' => 'UI');
|
||||
foreach($treetags as $tree => $tag)
|
||||
if(has_tree_been_edited($payload, $tree))
|
||||
$tags[] = $tag;
|
||||
@@ -392,14 +395,12 @@ function handle_pr($payload) {
|
||||
set_labels($payload, $labels, $remove);
|
||||
if($no_changelog)
|
||||
check_dismiss_changelog_review($payload);
|
||||
/*
|
||||
if(get_pr_code_friendliness($payload) <= 0){
|
||||
$balances = pr_balances();
|
||||
$author = $payload['pull_request']['user']['login'];
|
||||
if(isset($balances[$author]) && $balances[$author] < 0 && !is_maintainer($payload, $author))
|
||||
create_comment($payload, 'You currently have a negative Fix/Feature pull request delta of ' . $balances[$author] . '. Maintainers may close this PR at will. Fixing issues or improving the codebase will improve this score.');
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case 'edited':
|
||||
check_dismiss_changelog_review($payload);
|
||||
@@ -642,36 +643,38 @@ function get_pr_code_friendliness($payload, $oldbalance = null){
|
||||
$labels = get_pr_labels_array($payload);
|
||||
//anything not in this list defaults to 0
|
||||
$label_values = array(
|
||||
'Fix' => 2,
|
||||
'Refactor' => 2,
|
||||
'CI/Tests' => 3,
|
||||
'Code Improvement' => 1,
|
||||
'Fix' => 3,
|
||||
'Refactor' => 10,
|
||||
'Code Improvement' => 2,
|
||||
'Grammar and Formatting' => 1,
|
||||
'Priority: High' => 4,
|
||||
'Priority: CRITICAL' => 5,
|
||||
'Priority: High' => 15,
|
||||
'Priority: CRITICAL' => 20,
|
||||
'Unit Tests' => 6,
|
||||
'Logging' => 1,
|
||||
'Feedback' => 1,
|
||||
'Performance' => 3,
|
||||
'Feature' => -1,
|
||||
'Balance/Rebalance' => -1,
|
||||
'PRB: Reset' => $startingPRBalance - $oldbalance,
|
||||
'Feedback' => 2,
|
||||
'Performance' => 12,
|
||||
'Feature' => -10,
|
||||
'Balance/Rebalance' => -8,
|
||||
'Tweak' => -2,
|
||||
'GBP: Reset' => $startingPRBalance - $oldbalance,
|
||||
);
|
||||
|
||||
$affecting = 0;
|
||||
$is_neutral = FALSE;
|
||||
$found_something_positive = false;
|
||||
$maxNegative = 0;
|
||||
$maxPositive = 0;
|
||||
foreach($labels as $l){
|
||||
if($l == 'PRB: No Update') { //no effect on balance
|
||||
$affecting = 0;
|
||||
break;
|
||||
if($l == 'GBP: No Update') { //no effect on balance
|
||||
return 0;
|
||||
}
|
||||
else if(isset($label_values[$l])) {
|
||||
$friendliness = $label_values[$l];
|
||||
if($friendliness > 0)
|
||||
$found_something_positive = true;
|
||||
$affecting = $found_something_positive ? max($affecting, $friendliness) : $friendliness;
|
||||
$maxPositive = max($friendliness, $maxPositive);
|
||||
else
|
||||
$maxNegative = min($friendliness, $maxNegative);
|
||||
}
|
||||
}
|
||||
|
||||
$affecting = abs($maxNegative) >= $maxPositive ? $maxNegative : $maxPositive;
|
||||
return $affecting;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ announce_unvalidated - Announce prs by unvalidated users (see the validation set
|
||||
Can also be set to 'only' to only announce prs by unvalidated users.
|
||||
$servers[$configitem]['announce_unvalidated'] = false;
|
||||
|
||||
//Note: the same webhook or game server can be given in mutiple announce endpoints with different settings, allowing you to say, have embeds only show on prs to certain repos by excluding the repo in a endpoint with embed = false, and including the repo in a endpoint with embed = true true. This could also be used to only block closed and reopened events on prs by unvalidated users.
|
||||
//Note: the same webhook or game server can be given in mutiple announce endpoints with different settings, allowing you to say, have embeds only show on prs to certain repos by excluding the repo in an endpoint with embed = false, and including the repo in an endpoint with embed = true true. This could also be used to only block closed and reopened events on prs by unvalidated users.
|
||||
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ $configitem = -1;//ignore me
|
||||
$discordWebHooks[++$configitem] = array();
|
||||
|
||||
// Webhook Url (you can get this from discord via the webhook setting menu of the server or a channel.)
|
||||
$discordWebHooks[$configitem]['url'] = 'https://discordapp.com/api/webhooks/538933489920245771/xaoYtVuype-P1rb_uthQLkh_C4iVL3sjtIvFEp7rsfhbBs8tDsSJgE0a9MNWJaoSPBPK';
|
||||
$discordWebHooks[$configitem]['url'] = 'https://discord.com/api/webhooks/538933489920245771/xaoYtVuype-P1rb_uthQLkh_C4iVL3sjtIvFEp7rsfhbBs8tDsSJgE0a9MNWJaoSPBPK';
|
||||
|
||||
// show an embed with more info?
|
||||
$discordWebHooks[$configitem]['embed'] = true;
|
||||
@@ -118,7 +118,7 @@ $discordWebHooks[$configitem]['no_text'] = false;
|
||||
$discordWebHooks[++$configitem] = array();
|
||||
|
||||
// Webhook Url (you can get this from discord via the webhook setting menu of the server or a channel.)
|
||||
$discordWebHooks[$configitem]['url'] = 'https://discordapp.com/api/webhooks/538933686956064769/q0uDel7S6eutvRIyEwsuZo_ppzAoxqUNeU2PRChYVsYoJmmn2f2YYSDoMjy9FhhXKqpI';
|
||||
$discordWebHooks[$configitem]['url'] = 'https://discord.com/api/webhooks/538933686956064769/q0uDel7S6eutvRIyEwsuZo_ppzAoxqUNeU2PRChYVsYoJmmn2f2YYSDoMjy9FhhXKqpI';
|
||||
|
||||
// show an embed with more info?
|
||||
$discordWebHooks[$configitem]['embed'] = true;
|
||||
|
||||
Reference in New Issue
Block a user