fix(API): Match repo_sync events to the correct response #747
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use
phrase-cli
in our CI/CD pipeline to automate merges to our repositories. However, the recent changes introduced in #735 have broken our process.While upgrading our pipeline to use
repo_sync
, I encountered the following issues withphrase-cli
:Issues Description
Missing
event_type
andpull_request_url
phrase-cli
does not provide theevent_type
of the sync event or thepull_request_url
. These details are critical for avoiding multiple merge requests in our CI/CD.type
instead ofevent_type
, which caused discrepancies in the schemas. I’ve updated the schemas in this PR to match the API response.Reproduction
Example with
phrase-cli
:Example with curl (fetching type but missing pull_request_url):
I’ve updated the schemas in this PR to match the API response.
Command Parsing conflicts::
When parsing the commands in api_repo_syncs.go#L169 and api_repo_syncs.go#L499, a conflict arises as shown in (this snippet)[https://go.dev/play/p/DoeBHQOf-oI]
For instance, the output of the help command demonstrates duplicate show commands:
I changed the
operationId
to berepo_sync/events_show
so it will create a new commandevents_show
avoiding the conflictExtra fixes:
Documentation Discrepancy:
Some API references use repo_sync where they should use repo_syncs.
The API documentation for Get a Single Repo Sync Event incorrectly references the command as repo_sync_event. So I took the opportunity to correct this in the documentation.
Request for Additional Fix
API does not return the
pull_request_url
. This seems to be in a private repository. It would be great if this could be addressed as it’s essential for our CI/CD workflow.