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

"Result" type in POST body #11

Open
parnic-sks opened this issue Apr 11, 2024 · 2 comments
Open

"Result" type in POST body #11

parnic-sks opened this issue Apr 11, 2024 · 2 comments

Comments

@parnic-sks
Copy link

Hi there,

Thanks for providing this solution! I was about to write my own today to replace our IIS installation, but found this project so I'm glad I don't have to :).

I'm running the rugs:latest Docker image as of today (2024/04/11) and am having an issue with the example POST body as well as our existing internal tooling that's already interacting with Epic's IIS version. When attempting to post this body from the readme:

{
  "Project": "//myproject/main/MyProject",
  "ChangeNumber": 123,
  "BuildType": "Editor",
  "Result": "Starting",
  "Url": "https://my.ci/jobs/100"
}

I get the following response:

Failed to deserialize the JSON body into the target type: Result: invalid type: string "Starting", expected u8 at line 5 column 22

Based on the TeamCity plugin's source, it looks like the Result is actually expecting the integer value of the Starting constant rather than the name, so I tried this and it did work:

{
  "Project": "//myproject/main/MyProject",
  "ChangeNumber": 123,
  "BuildType": "Editor",
  "Result": 0,
  "Url": "https://my.ci/jobs/100"
}

Is this expected? Should we be able to use the name of the Result status (compatible with Epic's UGS) or do we have to use the numeric value of the enum instead?

Additionally, the readme says:

If you want more control over submitting badges from CI, you can make a POST request to /builds

I assume this is supposed to say "to /api/build" since that's what the handler is listening for.

@jorgenpt
Copy link
Owner

Should we be able to use the name of the Result status (compatible with Epic's UGS) or do we have to use the numeric value of the enum instead?

When you say "compatible with Epic's UGS", are you referring to the PostBadgeStatus.exe program from the UGS project? If so, yes, it should be compatible, but it's not something we use at our studio, so it's possible it's not working as expected.

I assume this is supposed to say "to /api/build" since that's what the handler is listening for.

Ah, thank you! I will make sure to fix that.

jorgenpt added a commit that referenced this issue Apr 11, 2024
Thanks to @parnic-sks in #11 for pointing it out.
@parnic-sks
Copy link
Author

Should we be able to use the name of the Result status (compatible with Epic's UGS) or do we have to use the numeric value of the enum instead?

When you say "compatible with Epic's UGS", are you referring to the PostBadgeStatus.exe program from the UGS project? If so, yes, it should be compatible, but it's not something we use at our studio, so it's possible it's not working as expected.

We don't actually use PostBadgeStatus either, so I'm not 100% confident, but I believe it posts Result as a string, which is where I got my implementation from. Your example also has Result as a string, which doesn't appear to work. We have an internal PostBadgeStatus implementation we use at our studio that posts "Result": "Success", for example.

By "compatible with Epic's UGS" I meant that RUGS could be swapped in without anyone noticing (other than the database missing entries from the other version), and right now that's not possible due to the Result type mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants