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

Fix the introspection GitHub action tests (Feb 2024) #1542

Closed
palisadoes opened this issue Feb 4, 2024 · 13 comments
Closed

Fix the introspection GitHub action tests (Feb 2024) #1542

palisadoes opened this issue Feb 4, 2024 · 13 comments
Assignees
Labels
bug Something isn't working feature request

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Feb 4, 2024

Is your feature request related to a problem? Please describe.

  1. Our introspection PR tests have been failing. This seems to be caused by code that references now deprecated Event and User task functionality.
  2. Here is a recent example:
    1. https://github.com/PalisadoesFoundation/talawa-admin/actions/runs/7774376104/job/21199116216?pr=1539

image

Describe the solution you'd like

This issue has two parts. We have a history of this error repeating itself and it needs to be finally resolved permanently

Short Term Solution

  1. Update the offending code to make the introspection tests pass
  2. All existing tests must pass and must be valid tests of the code base
  3. No other functionality must be affected

Long Term Solution

  1. Determine what is causing the problem where the API and Admin repos are periodically out of sync and fix it.
  2. We think it may be caused by this issue not being successfully resolved. You may need to coordinate with the person assigned this issue
    1. Fix our Introspection Schema check GitHub Action talawa-api#1599
  3. NOTE: This may mean creating a GitHub action to automatically create issues when an API PR is merged where the schema is updated.
  4. All existing tests must pass and must be valid tests of the code base
  5. No other functionality must be affected

Describe alternatives you've considered

  • N/A

Approach to be followed (optional)

  • See above

Additional context

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@palisadoes palisadoes added the bug Something isn't working label Feb 4, 2024
@akhilender-bongirwar
Copy link
Contributor

I would like to work on this issue.

@palisadoes
Copy link
Contributor Author

Please read the updated long term solution section

@akhilender-bongirwar
Copy link
Contributor

@palisadoes Sir,

For the Short-Term Solution to the introspection PR test failure, we can revert this #1499 in talawa-admin for now. We should wait for this PR in talawa-api to be merged first. Afterward, we can merge that PR into talawa-admin.

@akhilender-bongirwar
Copy link
Contributor

@palisadoes Sir, just a quick follow-up on the short-term solution proposal for the introspection PR test failure. I am still awaiting your opinion. Thank you.

@palisadoes
Copy link
Contributor Author

We didn't realize that the two PRs were linked.

I'd prefer not to revert. Will the introspection be fixed after the API merge?

@palisadoes
Copy link
Contributor Author

What about the line term solution?

@akhilender-bongirwar
Copy link
Contributor

We didn't realize that the two PRs were linked.

I'd prefer not to revert. Will the introspection be fixed after the API merge?

Yes, sir the introspection will be fixed after the API merge.

@akhilender-bongirwar
Copy link
Contributor

What about the line term solution?

Sir, these are few points I would like to address

Observations

  1. The talawa-api schema is ahead of the admin schema, which has not caused any issues in the regular functioning of the talawa-admin portal.

  2. Attributes required for new features in the admin schema have been sourced from talawa-api.

  3. The GraphQL introspection failure typically occurs when new attributes are declared in the admin schema but are not defined in the API schema. These attributes often lack defined logic, resulting in potential failures for associated actions/functions.

  4. We already have a dedicated Graphql-Inspector GitHub Action to handle the scenario mentioned above.

Fix

  • When adding a new attribute in admin schema for a fix or feature, it's crucial to declare that attribute in the API schema first and then use it in the admin. This approach prevents introspection errors and ensures the smooth operation of our application without errors.

Remarks

  • Sir, IMO, it is better we have the API schema ahead of the admin schema. This ensures that development is not halted in the API, and it allows us to create new features in admin using those attributes.
  • This practice does not pose any issues for the development server.
  • We should only be cautious about preventing errors when new attributes added to the admin schema are not declared in the API schema. Until this error is addressed, everything else will function correctly.

@akhilender-bongirwar
Copy link
Contributor

What about the line term solution?

Sir, these are few points I would like to address

Observations

1. The `talawa-api schema` is ahead of the `admin schema`, which has not caused any issues in the regular functioning of the `talawa-admin` portal.

2. Attributes required for new features in the admin `schema` have been sourced from `talawa-api`.

3. The `GraphQL introspection` failure typically occurs when new attributes are declared in the admin schema but are not defined in the API schema. These attributes often lack defined logic, resulting in potential failures for associated actions/functions.

4. We already have a dedicated `Graphql-Inspector` GitHub Action to handle the scenario mentioned above.

Fix

* When adding a new attribute in `admin schema` for a fix or feature, it's crucial to declare that attribute in the `API schema` first and then use it in the admin. This approach prevents introspection errors and ensures the smooth operation of our application without errors.

Remarks

* Sir, IMO, it is better we have the `API schema` ahead of the `admin schema`. This ensures that development is not halted in the API, and it allows us to create new features in admin using those attributes.

* This practice does not pose any issues for the development server.

* We should only be cautious about preventing errors when new attributes added to the admin schema are not declared in the API schema. Until this error is addressed, everything else will function correctly.

@palisadoes, sir, I would like to know your thoughts on this.

@palisadoes
Copy link
Contributor Author

We should only be cautious about preventing errors when new attributes added to the admin
schema are not declared in the API schema. Until this error is addressed, everything else will
function correctly.

How could we adjust our introspection test to fail in this case but not when the API is ahead of Admin?

@akhilender-bongirwar
Copy link
Contributor

akhilender-bongirwar commented Feb 8, 2024

@palisadoes sir,

[log] - Field 'id' is not defined by type 'UpdateUserInput'.
 - Field 'applangcode' is not defined by type 'UpdateUserInput.'
  • These were the exact fields added to the schema which were not defined in the schema in the api.
  • It is evident that from this PR merge, the workflow is not affected by the API being ahead of the admin.

@palisadoes
Copy link
Contributor Author

OK, thanks

@palisadoes
Copy link
Contributor Author

  1. Based on this discussion, it sounds like we really have an issue.
  2. I'll close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request
Projects
None yet
Development

No branches or pull requests

2 participants