Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of dev work #920

Merged
merged 14 commits into from
Apr 12, 2020
Merged

A bunch of dev work #920

merged 14 commits into from
Apr 12, 2020

Conversation

Cyberboss
Copy link
Member

Closes #894
Closes #913

🆑
Most failed requests now come with an error code defined in the API spec.
We now independently version several internal components such as the REST and DM APIs.
A hard limit of 1000 UTF-8 characters have been added to most strings in models.
Improved server-side validation of many models.
It's no longer possible to set rights enums to invalidly high values.
It's no longer possible to create multiple users with the same system identifier.
Fixed chat bot names conflicting with those in separate instances.
Added configurable limits for the maximum number of users and instances in the server.
/:cl:

- API and client to version 5.0.0
- Added a bunch more model validations
- Added error codes
- Added limits to database strings
- Redid client exceptions to be more sane
- Added configurable instance and user limits
- Always clamp rights to their valid ranges
- Add an error if the minimum password length is more than the string limit
- Fixed chat bot name contraints crossing instances
- Enforce that SIDs be unique globally
- Normalize instance paths to forward slashes on windows. Added to sanitizer
- Added migrations
- Added ApiAssert for testing error codes
@Cyberboss Cyberboss added Client Issue with the .NET client library Fix Fixes incorrect functionality Feature New functionality Major Version Bump REST The JSON REST API for server control Area: DMAPI Communication between TGS and DM Controller Issue Issue regarding the HTTP request controllers Configuration Regarding the server setup JSON Host Watchdog Change A change to one of the Host./<Watchdog/Service/Console> projects which do not receive auto updates Migration Requires or performs a database migration labels Apr 11, 2020
@Cyberboss Cyberboss added this to the v4.1.0 milestone Apr 11, 2020
@@ -1,5 +1,7 @@
//tgstation-server DMAPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could convert the comments here to follow dmdoc spec

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we dmdoc tgs do we

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's a concrete part of the tg repo so it's subject to it like everything else.

Regardless, I think I'll exclude it, the DMAPI is meant to document itself with this file.

Comment on lines 18 to 22
var attributes = (DescriptionAttribute[])typeof(ErrorCode)
.GetField(errorCode.ToString())
?.GetCustomAttributes(typeof(DescriptionAttribute), false);

return attributes.FirstOrDefault()?.Description;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attributes.FirstOrDefault() will throw null reference when GetField returns null

if you're using ?. after GetField it may be worth checking for that null on the return line

Comment on lines 132 to 134
'"' + assemblyPath + '"',
'"' + updateDirectory + '"'
'"' + updateDirectory + '"',
'"' + watchdogVersion + '"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use string interpolation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly cause the Host.Watchdog component is a dirt simple shitcode hack on top of the actual server that I didn't put much effort into.

#924 and will fix this here.

@codecov
Copy link

codecov bot commented Apr 12, 2020

Codecov Report

Merging #920 into dev will decrease coverage by 0.37%.
The diff coverage is 31.41%.

@@            Coverage Diff             @@
##              dev     #920      +/-   ##
==========================================
- Coverage   45.64%   45.27%   -0.38%     
==========================================
  Files         249      258       +9     
  Lines       24645    26996    +2351     
  Branches    15805    17761    +1956     
==========================================
+ Hits        11250    12222     +972     
- Misses      13330    14709    +1379     
  Partials       65       65              

@Cyberboss Cyberboss merged commit 91300c7 into dev Apr 12, 2020
@Cyberboss Cyberboss deleted the 894-ErrorCodes branch April 12, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: DMAPI Communication between TGS and DM Client Issue with the .NET client library Configuration Regarding the server setup JSON Controller Issue Issue regarding the HTTP request controllers Feature New functionality Fix Fixes incorrect functionality Host Watchdog Change A change to one of the Host./<Watchdog/Service/Console> projects which do not receive auto updates Migration Requires or performs a database migration REST The JSON REST API for server control
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create separate versions Add error codes to all ErrorMessages
2 participants