-
Notifications
You must be signed in to change notification settings - Fork 16
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
[DRUP-610] Add url as source for apidocs spec file and (DRUP-459) allow re-fetching it afterwards. #2
[DRUP-610] Add url as source for apidocs spec file and (DRUP-459) allow re-fetching it afterwards. #2
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
'%label' => $this->entity->label(), | ||
])); | ||
} | ||
// TODO: $needs_save doesn't tell us if something went wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly why I suggested earlier to throw an exception when file fetching or saving fails instead of returning a boolean indicator value which is not the OOP solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO was added so it can be changed in a follow up task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is the related follow-up task to this? Probably it would be better to create it as a GH issue, because that could be referenced in this PR.
Also, please keep in mind that if this module gets stable before this issue gets fixed then technically, you should not change what it is in SpecFetcherInterface::fetchSpec()
without releasing a new major version because that would be a BC breaking change. So any implementation that implements this interface should not throw any exception and should always return a boolean value because this is what it is in the contract.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Plugin/Validation/Constraint/ApiDocFileLinkConstraintValidator.php
Outdated
Show resolved
Hide resolved
private function checkRequirements(string $destination): void { | ||
// If using private filesystem, check that it's been configured. | ||
if (strpos($destination, 'private://') === 0 && !$this->isPrivateFileSystemConfigured()) { | ||
throw new \Exception('Private filesystem has not been configured.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem with addressing this in a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is the related follow-up task to this? Probably it would be better to create it as a GH issue, because that could be referenced in this PR.
$this->httpClient = $http_client; | ||
$this->entityTypeManager = $entityTypeManager; | ||
$this->messenger = $messenger; | ||
$this->logger = $logger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is a micro-optimization, I have no problem addressing it in a followup task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is the related follow-up task to this? Probably it would be better to create it as a GH issue, because that could be referenced in this PR.
#2 (comment) |
There are no new tests in this PR. Tests will be added in a followup PR. Existing test results:
|
Co-Authored-By: Chris Novak <chrisnovak@google.com>
Co-Authored-By: Chris Novak <chrisnovak@google.com>
…e to spec_file_source and make it list_string type.
… `apidoc` entities.
The default value for the `http_errors` option is `TRUE`.
[DRUP-624] Add revisions to API Docs.
….com/Jaesin/apigee-api-catalog-drupal into Jaesin-8.x-1.x-DRUP-610-459-apidocs-add-url # Conflicts: # apigee_api_catalog.links.task.yml # src/Entity/Access/ApiDocAccessControlHandler.php # src/Entity/ApiDoc.php # src/Entity/ApiDocInterface.php # src/Entity/Form/ApiDocForm.php Also updated ApidocEntityTest.php w/ options & file_link modules to get tests to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good now w/latest updates, should have issues in for anything outstanding. After merging other commits this PR had conflicts. I resolved merge conflicts, then ran phpcs and phpunit and all tests now pass.
However, @Jaesin you should look over ApiDocAccessControlHandler:checkAccess() to make sure that method was properly merged.
Test results:
../vendor/bin/phpunit --configuration core modules/contrib/apigee_api_catalog/
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Testing modules/contrib/apigee_api_catalog/
.............. 14 / 14 (100%)
Time: 3.36 minutes, Memory: 10.00MB
OK (14 tests, 158 assertions)
|
Continuation of: apigee/apigee-edge-drupal#191