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

feat(next): dynamic consumer paths #623

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mglaman
Copy link
Contributor

@mglaman mglaman commented Dec 7, 2023

Provides dynamic consumer paths from generated URL using Consumer
collection route.

fixes #615

This pull request is for: (mark with an "x")

  • examples/*
  • modules/next
  • packages/next-drupal
  • starters/basic-starter
  • starters/graphql-starter
  • Other

GitHub Issue: #615
Please add a link to the GitHub issue
where this problem is discussed.

  • I need help adding tests. (mark with an "x")
    Code changes need test coverage. If you don't know
    how to make tests, check this box to ask for help.

Describe your changes

Uses the collection route name and generates the relative URL.

Provides dynamic consumer paths from generated URL using Consumer
collection route.

fixes chapter-three#615
Copy link

vercel bot commented Dec 7, 2023

@mglaman is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

@mglaman
Copy link
Contributor Author

mglaman commented Dec 12, 2023

I just noticed the failures, will fix

@mglaman
Copy link
Contributor Author

mglaman commented Dec 12, 2023

Merged in main, seems like unrelated errors

@mglaman
Copy link
Contributor Author

mglaman commented Dec 13, 2023

Test needs consumers added to dependencies

@JohnAlbin
Copy link
Collaborator

From the error log:

1) Drupal\Tests\next\Kernel\Renderer\MainContent\NextSiteEntityControllerTest::testEnvironmentVariables
PHPUnit\Framework\Exception: Unavailable module: 'consumers'. If this module needs to be downloaded separately, annotate the test class with '@requires module consumers'.

@mglaman
Copy link
Contributor Author

mglaman commented Feb 22, 2024

Ah, need to add to require-dev, which the current workflow may not do. I'll update to ensure the dependency is available during tests

Copy link
Contributor Author

@mglaman mglaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still isn't right. It'll break at runtime without Conumers as a true dependency.

It should check if the module exists, then do

    $variables += [
      'authentication_bearer' => '# Authentication',
      'DRUPAL_CLIENT_ID' => 'Retrieve this from ' . $path,
      'DRUPAL_CLIENT_SECRET' => 'Retrieve this from ' . $path,
    ];

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

Successfully merging this pull request may close these issues.

NextSiteEntityController::environmentVariables consumer route should not be hardcoded
3 participants