Fix bug in Mutation.ciJobTokenScopeRemoveProject

Why this MR ?

  • To fix a bug in our GQL API for the mutation - Mutation.ciJobTokenScopeRemoveProject

  • We have a bug in our GQL API - wherein a project cannot be removed from the Job Token Scope of another project via our GQL API. We get the error Target project is not in the job token scope even when the project is present in the Job Token Scope of the project. However removing the project via UI click works fine. The error happens only when removing the project via the GQL API

  • As per our docs, the now deprecated direction argument for the GQL mutation ciJobTokenScopeRemoveProject - can now only be set to INBOUND as Outbound job token scope is being removed

  • In the frontend code, we are correctly setting the default value of direction parameter to INBOUND

  • However in the application usage via GQL API - This is not the default behaviour. When the direction parameter is NOT passed to the mutation on the Rails side, it sets OUTBOUND as the default value here which causes the mentioned error as the project that we are trying to remove is NOT in the OUTBOUND scope

What does this MR do ?

  • This MR fixes the bug by updating the default value of the direction parameter in the mutation to inbound rather than outbound
  • Update unit tests

References

Issue

Screenshots

Before After
before After

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jayakrishnan Mallissery

Merge request reports

Loading