Skip to content

Conversation

@gh0stsh0t
Copy link
Contributor

@gh0stsh0t gh0stsh0t commented Aug 11, 2020

Description of what you did:

for: strapi-plugin-documentation
Changed the object equality method to use lodash's is equal to avoid unordered properties returning false
Changed createDocObject's merge to concat arrays instead of overwriting them
fix #7399
fix #7509

@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #7420 (ad41f7a) into master (cbc3375) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7420   +/-   ##
=======================================
  Coverage   34.64%   34.64%           
=======================================
  Files        1308     1308           
  Lines       14393    14393           
  Branches     1422     1422           
=======================================
  Hits         4987     4987           
  Misses       8497     8497           
  Partials      909      909           
Flag Coverage Δ
front 26.04% <ø> (ø)
unit 55.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e65de6...eef304e. Read the comment docs.

areObjectsEquals: (obj1, obj2) => {
return JSON.stringify(obj1) === JSON.stringify(obj2);
// stringify to remove nested empty objects
return _.isEqual(JSON.parse(JSON.stringify(obj1)), JSON.parse(JSON.stringify(obj2)))
Copy link
Member

Choose a reason for hiding this comment

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

Do you really need the JSON.parse of JSON.stringify here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, checking on this again, JSON.stringify works on its own apparently, but it isn't consistent, it still will fail if there is more than a single tag and isn't ordered in the same way. I had to create a custom comparator to check for arrays in the object
image
image

@gh0stsh0t gh0stsh0t requested a review from a team October 27, 2020 16:17
@strapi-cla
Copy link

strapi-cla commented Nov 30, 2020

CLA assistant check
All committers have signed the CLA.

@alexandrebodin alexandrebodin added source: docs Documentation changes source: plugin:documentation Source is plugin/documentation package and removed source: docs Documentation changes labels Dec 4, 2020
@gh0stsh0t gh0stsh0t requested review from alexandrebodin and removed request for a team December 29, 2020 02:08
@micahbule
Copy link

Any updates on this one? This is ruining auto-deploy scripts at the moment.

@alexandrebodin alexandrebodin added the issue: bug Issue reporting a bug label Jan 8, 2021
@alexandrebodin alexandrebodin added this to the 3.4.2 milestone Jan 8, 2021
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you !

@alexandrebodin alexandrebodin merged commit dd27a56 into strapi:master Jan 8, 2021
@derrickmehaffy
Copy link
Member

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/google-app-engine-readonly-vs-plugin-api-documentation-generation/468/7

@aquadesk
Copy link
Contributor

I still get error in app engine

2021-08-30 05:16:14 default[20210829t214453]  [2021-08-30T05:16:14.616Z] error Error: EROFS: read-only file system, open '/workspace/extensions/documentation/documentation/1.0.0/full_documentation.json'
2021-08-30 05:16:14 default[20210829t214453]      at Object.openSync (fs.js:498:3)
2021-08-30 05:16:14 default[20210829t214453]      at Object.writeFileSync (fs.js:1524:35)
2021-08-30 05:16:14 default[20210829t214453]      at module.exports (/workspace/node_modules/strapi-plugin-documentation/config/functions/bootstrap.js:106:8)
2021-08-30 05:16:14 default[20210829t214453]      at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-08-30 05:16:14 default[20210829t214453]      at async Promise.all (index 2)
2021-08-30 05:16:14 default[20210829t214453]      at async Strapi.runLifecyclesFunctions (/workspace/node_modules/strapi/lib/Strapi.js:443:5)
2021-08-30 05:16:14 default[20210829t214453]      at async Strapi.load (/workspace/node_modules/strapi/lib/Strapi.js:379:5)
2021-08-30 05:16:14 default[20210829t214453]      at async Strapi.start (/workspace/node_modules/strapi/lib/Strapi.js:196:9)
2021-08-30 05:16:15 default[20210829t214453]  "GET /favicon.ico HTTP/1.1" 204
    "strapi": "3.6.8",
    "strapi-admin": "3.6.8",
    "strapi-connector-bookshelf": "3.6.8",
    "strapi-connector-firestore": "^3.0.0-alpha.40",
    "strapi-plugin-content-manager": "3.6.8",
    "strapi-plugin-content-type-builder": "3.6.8",
    "strapi-plugin-documentation": "3.6.8",
    "strapi-plugin-email": "3.6.8",
    "strapi-plugin-i18n": "3.6.8",
    "strapi-plugin-upload": "3.6.8",
    "strapi-plugin-users-permissions": "3.6.8",
    "strapi-provider-upload-google-cloud-storage": "3.6.5",
    "strapi-utils": "3.6.8"

@aquadesk
Copy link
Contributor

nevermind, I generated the doc in localhost and push it to prod and it worked.
sorry!

@jkqubix
Copy link

jkqubix commented May 12, 2022

For me this doesn't work. I have a Strapi installed, each time I deploy it to Google Cloud's App Engine Strapi tries to read/write into a documentation file.

For example I have a custom api endpoint under docs. Strapi apparently tries to generate documentation for it:
image

This happens also with all Strapi generated content-types I have (removing the docs api endpoint doesn't help).

I have also observed that every time I start the server on localhost "x-generation-date" gets regenerated. That could also cause a problem (and I have seen this in a different issue, apparently marked as fixed).

I use Strapi and Documentation with version 4.1.10.

Is there a way how to make the documentation generation manual or turn it off (e. g. to have it only when I launch Strapi in develop mode) and prevent documentation generation on production?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

issue: bug Issue reporting a bug source: plugin:documentation Source is plugin/documentation package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x-generation-date gets updated on every server restart Documentation plugin will always write to full_documentation.json

7 participants