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 broken uri-use page links in updated reference docs of develop branch #1518

Conversation

aj-stein-nist
Copy link
Contributor

@aj-stein-nist aj-stein-nist commented Oct 18, 2022

Committer Notes

This PR should fix failures on various PRs pointed to develop branch that are failing after the merge of #1263. It should fix website link checking on the following PRs:

All Submissions:

By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.

@aj-stein-nist aj-stein-nist self-assigned this Oct 18, 2022
@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch 4 times, most recently from a5429d8 to b42f640 Compare October 19, 2022 12:46
@aj-stein-nist
Copy link
Contributor Author

I talked with Dave about this yesterday afternoon and it really seems we do not want to ignore non-existent pages, but revive the attempt to use the remapping feature and circle back with the upstream developer re lycheeverse/lychee#683 (similar use case, just different example as it pertains to our CI/CID checking). Will work towards quickly fixing that. Also removing relative paths that will confuse this remapping (the erroneous file:/// URI links that failed are because of a few relative paths that slipped into the source Metaschema definitions that are being checked).

@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch 6 times, most recently from 6ca69ae to 22d5253 Compare October 20, 2022 13:31
@aj-stein-nist aj-stein-nist marked this pull request as ready for review October 20, 2022 13:31
@aj-stein-nist
Copy link
Contributor Author

aj-stein-nist commented Oct 20, 2022

@david-waltermire-nist I am hopefully running this one for the last time. Even with updated configuration to look at local files (and avoid this inception problem with staged new files that are check-in but not "published" in nist-pages branch and triggered to get sent to pages.nist.gov) the path remapping is not so smart so saying "remap https://pages.nist.gov/OSCAL to /path/to/github/workspace/docs/public" (with updated site build) errors with the URL path not having OSCAL in it:

file:///home/runner/work/OSCAL/OSCAL/docs/public/OSCAL/concepts/uri-use: Failed: Cannot find file (status code: ERR)

From this last run before force-pushed commit on Metaschema @href changes: observe that /OSCAL/ is in the middle of paths in the local filesystem but only matter on the deployed server, despite the remap. I think this it the best we can do for now. I had to switch back to relative paths, but the kicker is they must be super-relative and I checked main Metaschema defs: it must be href="/concepts/..." and not href=/OSCAL/concepts/...", that breaks it like how we will continue getting this error ☝️. Oh well!

@aj-stein-nist aj-stein-nist changed the title Exempt uri-use page from link checking. Fix broken uri-use page links in updated reference docs Oct 21, 2022
@aj-stein-nist aj-stein-nist changed the title Fix broken uri-use page links in updated reference docs Fix broken uri-use page links in updated reference docs of develop branch Oct 21, 2022
Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.
@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch from 2d93008 to 61540e6 Compare October 21, 2022 04:11
@aj-stein-nist
Copy link
Contributor Author

@david-waltermire-nist this is finally ready for review. It did not occur to me what you were suggesting earlier today, but now think I understand. To avoid monkeying around further to override branch and remote protections. I use the local docker container to not only change Metaschema url definitions to relative, and update the config to have lychee scan locally mapped file:///path/to/website urls. What I hadn't done was force updates of the model reference content accordingly for the develop branch. I apologize I had not figured this out sooner.

This is good to go. I know it is unfortunately I must manually add in the model reference docs (from running /oscal/build/ci-cd/generate-model-documentation.sh -b develop -v in the container), but this will resolve the issues with the remaining 36 files with the source files changed and the rendered target docs which were missing.

Ironically, in a way this relates to #1447 in an edge case we usually don't need, but I will keep that in mind for the future.

Copy link
Contributor

@david-waltermire david-waltermire left a comment

Choose a reason for hiding this comment

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

@aj-stein-nist I'd really like to find a way to not change the absolute links in the metaschema from https://pages.nist.gov/OSCAL/ to /. This make the links unusable for someone browsing a metaschema. They have no way of knowing where they point.

@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch 2 times, most recently from 02a17c3 to 5861ba4 Compare October 31, 2022 14:44
@aj-stein-nist
Copy link
Contributor Author

@aj-stein-nist I'd really like to find a way to not change the absolute links in the metaschema from https://pages.nist.gov/OSCAL/ to /. This make the links unusable for someone browsing a metaschema. They have no way of knowing where they point.

Done and done. It appears that the issues I thought I had doing that before were the other issues you had pointed out to me while I was out on leave.

Also, @david-waltermire-nist, as discussed in the other PR, all is working except for the other issue that I fixed with bad, old Markdown links (to keep it organized and logically separate) in #1534. If you want to point there here instead of main, let me know and I will adjust accordingly.

@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch from 5861ba4 to cb0682f Compare October 31, 2022 15:26
@aj-stein-nist aj-stein-nist force-pushed the cleanup-ignore-uri-use-page-only-in-develop branch from cb0682f to d5c3f7b Compare October 31, 2022 15:36
@david-waltermire david-waltermire merged commit e5a3198 into usnistgov:develop Oct 31, 2022
david-waltermire pushed a commit that referenced this pull request Oct 31, 2022
…anch (#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after #1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
aj-stein-nist added a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jan 10, 2023
…anch (usnistgov#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
aj-stein-nist added a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Feb 6, 2023
…anch (usnistgov#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
aj-stein-nist added a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jun 29, 2023
…anch (usnistgov#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
aj-stein-nist added a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jul 10, 2023
…anch (usnistgov#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
@aj-stein-nist aj-stein-nist added this to the v1.1.0 milestone Jul 27, 2023
aj-stein-nist added a commit to galtm/OSCAL that referenced this pull request Sep 28, 2023
…anch (usnistgov#1518)

* Fix documentation relative paths in Metaschema

Recently added links in documentation refer to href="/OSCAL" and not
href="https://pages.nist.gov/OSCAL" in error or to simplify link gen
and lookup. Now that we are remapping the full URLs to local paths and
offsets for link-checking, we want these to be consistent across the
board in Metaschema after usnistgov#1263.

* Pushing generated website pages manual override [ci skip].

* Restore rel paths for develop branch ref model docs and fix link checks.

* Test full URLs per @dave-waltermire-nist's PR feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants