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

CollectionDocs: filter out doc_fragments and module_utils #340

Merged
merged 2 commits into from
Apr 14, 2021

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Apr 9, 2021

Fixes https://issues.redhat.com/browse/AAH-53

This alters the result of both CollectionsAPI.list (each item in the .data.data list) and CollectionsAPI.getCached (caching the altered version),
to filter the lists under latest_version.metadata.contents and (only in getCached) latest_version.docs_blob.contents
to remove any items with content_type module_utils or doc_fragments.

This also changes any previous code using latest_version.contents to use latest_version.metadata.contents instead.

Cc @newswangerd , @ZitaNemeckova

Affected screens:

  • list of collections (counters)
  • list of collections under namespace (counters)
  • collection detail, documentation tab (left side list)
  • collection detail, contents tab (counter and list)

Before:

before
xui repo published
xui repo published awcrosby
xui repo published awcrosby cisco_ios_test content

After:

after
ui repo published
ui repo published awcrosby
ui repo published awcrosby cisco_ios_test content

@newswangerd newswangerd self-requested a review April 9, 2021 19:54
himdel added 2 commits April 12, 2021 22:32
removing any items with content_type module_utils or doc_fragments, in any of these fields:
CollectionAPI.list: latest_version.contents, latest_version.metadata.contents
CollectionAPI.getCached: latest_version.contents, latest_version.metadata.contents, latest_version.docs_blob.contents

Fixes https://issues.redhat.com/browse/AAH-53
use latest_version.metadata.contents instead
both are the same now
@himdel
Copy link
Collaborator Author

himdel commented Apr 12, 2021

Updated to also fix the list screen counters, move the filtering to CollectionsApi, and deprecate latest_version.contents in favor of latest_version.metadata.contents :).

@himdel himdel merged commit c139cc7 into ansible:master Apr 14, 2021
@himdel himdel deleted the doc_fragment branch April 14, 2021 14:57
@newswangerd newswangerd added the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jun 1, 2021
@patchback
Copy link

patchback bot commented Jun 1, 2021

Backport to stable-4.3: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply c139cc7 on top of patchback/backports/stable-4.3/c139cc7839624be05a1d02a548ad2e6e6d318db3/pr-340

Backporting merged PR #340 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git add remote upstream https://github.com/ansible/ansible-hub-ui.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.3/c139cc7839624be05a1d02a548ad2e6e6d318db3/pr-340 upstream/stable-4.3
  4. Now, cherry-pick PR CollectionDocs: filter out doc_fragments and module_utils #340 contents into that branch:
    $ git cherry-pick -x c139cc7839624be05a1d02a548ad2e6e6d318db3
    If it'll yell at you with something like fatal: Commit c139cc7839624be05a1d02a548ad2e6e6d318db3 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x c139cc7839624be05a1d02a548ad2e6e6d318db3
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR CollectionDocs: filter out doc_fragments and module_utils #340 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.3/c139cc7839624be05a1d02a548ad2e6e6d318db3/pr-340
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@newswangerd newswangerd removed the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jun 1, 2021
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.

2 participants