Closed PatrickMNL closed 12 months ago
@andrii-bodnar I don't mind picking this up myself, if I can get permissions to open pull requests.
@PatrickMNL great, thank you! ๐
Feel free to fork the repo and create a PR
After some investigation, I found that both these status representations are being returned by the v2 API;
"status": "inProgress"
(Translations -> Build Status)"status": "in_progress"
(Bundles -> Build Status)A proper fix should probably be done on the API server side instead of in this package.
I can still offer a fix, but I don't really like the options I have of fixing it, what I considered:
@PatrickMNL thanks a lot for the investigation!
This should definitely be fixed on the API side. Passing it on to the development team
Alright, glad we're on the same page, thanks @andrii-bodnar! Would u have a ballpark estimate about when we can expect the fix? Just checking if it's worth waiting or that we should build in a small work around for now.
@PatrickMNL I will provide the exact estimate as soon as possible. It would be great if we could make a temporary workaround just to not block further integration.
@andrii-bodnar I have added 'temporary workaround' suggestion in this PR: https://github.com/crowdin/crowdin-api-client-dotnet/pull/169
Thanks for considering and merging the PR @andrii-bodnar, when can we expect a new release of the NuGet package? I would like to start using it with the fixes included ๐.
@PatrickMNL sure, I am going to release a new version in a few minutes
@PatrickMNL just released a new version - 2.14.3
@andrii-bodnar Thanks for the release! I see that the NuGet feed did not yet receive the new version, does that take a while or was it perhaps missed during the update?
Ignore the nuget feed question, I see it just got updated! Thanks again ๐!
@PatrickMNL thanks for your contribution to this project!
@andrii-bodnar can we consider migration to permanent solution for this case? For example add extra [Description]
attribute with "in_progress" value or create separate enum for Bundle API. As OP mentioned before.
Probably new value from API is already used by end users. We can avoid breaking backward compatibility just by fixing this on client side
@innomaxx thanks for the suggestions, I did also consider the second [Description] attribute, but unfortunately that .NET attribute doesn't allow for 2 occurences of the attribute on the same property.
We could also move away from the attribute and instead use a custom one, that allows for multiple names on a property. Or we could indeed consider the seperate enum for the BundleAPI (if we really want to fix this clientsided), both would require small adjustments to the current serialization flow.
I can see that backwards compatibility would indeed break for people with custom implementations, made during the time the Bundle API send back 'in_progress'.
Hi @PatrickMNL,
let's create a new class for bundle build status.
Having the status response in the _snakecase is more correct.
Due to some historical reasons, it was introduced in camelCase for the Build Project Translation
and Build Project Directory Translation
API methods and can't be changed now.
Currently, the following API endpoints have the _snakecase status response:
Export Bundle
Export Glossary
Import Glossary
Apply Pre-Translation
Export TM
Import TM
as well as the correcponding Check ... status
@andrii-bodnar thanks for the reply.
Can do, definitely, are you aware that introducing the new enum (class?), would cause 'breaking changes' when updating the package, as in, people will need to move their own Bundle implementations to this newly created enum.
If we're okay with that, than I can introduce a PR for that.
Something small to consider; If we're introducing breaking changes, we are also able to fix the existing BuildStatus and move the older incorrectly named variants to something like a LegacyBuildStatus.
@PatrickMNL Yes, we'll add a warning to the release notes about these breaking changes.
Something small to consider; If we're introducing breaking changes, we are also able to fix the existing BuildStatus and move the older incorrectly named variants to something like a LegacyBuildStatus.
I think this is a good idea!
@andrii-bodnar I have created the above PR as potential fix, I am able to test the Bundle API against our live implementation, we don't have a Translation/Directory API implementation internally, so I am unable to test those, is that something you can verify?
@PatrickMNL thanks a lot!
We have some examples in this repo, maybe it would be possible to test the new code using these examples?
When the
BundleExporter.CheckBundleExportStatus
returns a status of "in_progress" we run into the following JSON deserialization issue;Expected: It should properly parse the status to
BuildStatus.InProgress
.Reason: The Enum definition has a nice
Description
attribute above it which is read by a custom deserializer, but it is initialized withinProgress
instead ofin_progress
(perhaps because it has been changed recently?)