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

Finish pspdfkit labs search #703

Closed
wants to merge 5 commits into from
Closed

Finish pspdfkit labs search #703

wants to merge 5 commits into from

Conversation

tmcw
Copy link

@tmcw tmcw commented Dec 16, 2016

This branch addresses all of the current comments on #626: namely

  • Fix rubocop issues
  • Add changelog entry
  • Remove unused tempfile entry
  • Change --searchable to --unsearchable

The only thing that currently is tricky is that the self.document method is pushed from 20 to 21 lines, so it gets caught by rubocop. I see no clear way to make it shorter without making the code less direct, so happy to either adjust rubocop or take any approach the maintainers are happy with.

@DangerCI
Copy link

DangerCI commented Dec 16, 2016

1 Warning
⚠️ Big PR

Generated by 🚫 danger

@tmcw
Copy link
Author

tmcw commented Dec 16, 2016

Noting that tests are still failing: I didn't go through the dance of updating CI test fixtures. Looks like the steps to do that are in CONTRIBUTING.md and will require committing changes to the text fixture repo. (also, noting that to get the rake task to work i had to gem install bacon manually)

Test failures at: https://travis-ci.org/realm/jazzy/builds/184429638

@captainbarbosa want to take the baton in this magical relay race of open source feature production?

@captainbarbosa
Copy link
Collaborator

@tmcw I've updated the integration specs per the instructions in CONTRIBUTING.md

@jpsim I think this is ready to go, can we get push access so we can complete the final steps?

Also to note - while we were updating the integration spec, we had to update MiscJazzyFeatures Xcode project to explicitly set the SWIFT_VERSION to legacy:

=== BUILD TARGET MiscJazzyFeatures OF PROJECT MiscJazzyFeatures WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** BUILD FAILED **

I also had to recursively clone the submodules, which wasn't mentioned in the instructions within CONTRIBUTING.md - I can post a separate PR to include this.

@jpsim
Copy link
Collaborator

jpsim commented Dec 16, 2016

Oh hai mapbox! 👋

Thanks for pushing this forward! And of course thanks to @esad for the initial implementation.

I also had to recursively clone the submodules, which wasn't mentioned in the instructions within CONTRIBUTING.md - I can post a separate PR to include this.

Oh, that'd be great! Yes please.

I've just granted @captainbarbosa and @tmcw push access to both this repo and the integration specs repo.

Copy link
Collaborator

@jpsim jpsim left a comment

Choose a reason for hiding this comment

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

Just a few changes to make before this can go live. Nicely done @esad @tmcw @captainbarbosa !

@@ -246,6 +246,11 @@ def expand_path(path)
'https://github.com/realm/realm-cocoa/tree/v0.87.1)'

# ──────── Doc generation options ────────
config_attr :unsearchable,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be named either disable_search/--disable-search or skip_search/--skip-search to match the other options.

@@ -6,7 +6,8 @@

##### Enhancements

* None.
* By default, docs are now searchable. A new option, `--unsearchable`, lets you
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only the fullwidth theme appears to be searchable. Also, this should be reformatted to match the standard changelog entry format defined in https://github.com/realm/jazzy/blob/master/CONTRIBUTING.md#tracking-changes

With credit given to @esad, @tmcw and @captainbarbosa

@@ -0,0 +1,7 @@
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.7.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jpsim
Copy link
Collaborator

jpsim commented Dec 22, 2016

Would you like me to address the remaining feedback points, or should I leave that to you @tmcw?

@captainbarbosa
Copy link
Collaborator

@jpsim I made the changes as advised from your review - let me know if there's anything else I can do!

@jpsim
Copy link
Collaborator

jpsim commented Jan 6, 2017

Thanks @captainbarbosa. There's now a merge conflict with the changelog and the integration specs need to be rebuilt again.

@friedbunny
Copy link
Collaborator

Here’s the rubocop failure @tmcw mentioned:

lib/jazzy/doc_builder.rb:322:5: C: Method has too many lines. [21/20]
    def self.document(source_module, doc_model, path_to_root) ...
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

25 files inspected, 1 offense detected
RuboCop failed!

@friedbunny
Copy link
Collaborator

@jpsim We’re having some issues regenerating the integration specs. The new files from this PR are successfully added, but the docs generated for Siesta are inexplicably having sections removed:

diff --git a/document_siesta/after/api-docs/Classes/Resource.html b/document_siesta/after/api-docs/Classes/Resource.html
index 1c574ce..0fd0aee 100644
--- a/document_siesta/after/api-docs/Classes/Resource.html
+++ b/document_siesta/after/api-docs/Classes/Resource.html
@@ -740,29 +740,6 @@ up to you to canonicalize your parameter order.</p>
 <p>Note that, unlike load() and loadIfNeeded(), this method does <em>not</em> update latestData or latestError,
 and does not notify resource observers about the result.</p>
 
-<div class="aside aside-parameter">
-    <p class="aside-title">Parameter</p>
-    Parameter method: The HTTP verb to use for the request
-
-</div>
-
-<div class="aside aside-parameter">
-    <p class="aside-title">Parameter</p>
-    <p>Parameter requestMutation:
-An optional callback to change details of the request before it is sent. For example:</p>
-<pre class="highlight plaintext"><code>request(.POST) { nsreq in
-  nsreq.HTTPBody = imageData
-  nsreq.addValue(
-    "image/png",
-    forHTTPHeaderField:
-      "Content-Type")
-}
-</code></pre>
-
-<p>Does nothing by default.</p>
-
-</div>
-

Full diff of the spec regeneration is available here.

Siesta does not use the full-width theme and I therefore wouldn’t expect any changes to be made. document_siesta/after/execution_output.txt has only one lined changed and that one is expected: “building search index”.

Here’s the output from bundle exec rake rebuild_integration_fixtures. The relevant Siesta lines don’t have much information:

    Creates Siesta docs
      ✓ $ jazzy --output api-docs
      - execution_output.txt [FAILED]
      ✓ should not produce unexpected files

@friedbunny
Copy link
Collaborator

The above omissions do not happen when using 0.7.3, but still happen on this branch even when the --disable-search flag is used. 😞

@jpsim
Copy link
Collaborator

jpsim commented Jan 7, 2017

Yeah, the missing Siesta declaration is definitely a regression in this branch. I'm looking into it now.

@jpsim
Copy link
Collaborator

jpsim commented Jan 7, 2017

I'm guessing at this point that SearchBuilder.build(...) somehow mutates sourcemodule in such a way to remove the asides used by Siesta, but I don't see how it could actually do that.

@1ec5
Copy link
Collaborator

1ec5 commented Jan 7, 2017

The Siesta deletions aren't new: they started happening shortly after the latest release, but before my recent PRs: #702 (comment)

Do the integration specs pull in the latest version of the Siesta package, which could've changed, or does this necessarily point to a regression in jazzy?

@jpsim
Copy link
Collaborator

jpsim commented Jan 7, 2017

I think these specific siesta deletions are different, as running with the following patch preserves those asides:

--- a/lib/jazzy/doc_builder.rb
+++ b/lib/jazzy/doc_builder.rb
@@ -125,11 +125,6 @@ module Jazzy
       output_dir = options.output
       build_docs(output_dir, source_module.docs, source_module)
 
-      unless options.disable_search
-        warn 'building search index'
-        SearchBuilder.build(source_module, output_dir)
-      end
-
       copy_assets(output_dir)
 
       DocsetBuilder.new(output_dir, source_module).build!

@jpsim
Copy link
Collaborator

jpsim commented Jan 7, 2017

Actually, that's not even it. If I just run the siesta specs with this branch, the asides are also preserved. They just disappear if I run the whole test suite. Leading me now to think that it's some other mutation that's causing this...

@friedbunny
Copy link
Collaborator

The vanishing Siesta asides bisected to #697 — the integration spec apparently wasn’t updated properly for that PR. I’ve proposed realm/jazzy-integration-specs#25 to fix the issue, which simply accepts the deletions as proper.

@friedbunny
Copy link
Collaborator

friedbunny commented Jan 9, 2017

In 7825086, I went ahead and disabled the rubocop method length failure from #703 (comment).

Please let me know if there’s anything I’m missing, but I believe this is what’s left to do:

Excited to get this train into the station! 🙇

@SDGGiesbrecht
Copy link
Contributor

Thanks for fixing the specs.

@jpsim
Copy link
Collaborator

jpsim commented Jan 9, 2017

Your prognosis and fixes look right to me @friedbunny! Thanks for everything. Let's get this green by pushing the rebuilt integration specs and pointing this branch to it.

@friedbunny
Copy link
Collaborator

Awesome! I don’t have push access, but I was going to tag @captainbarbosa in again, anyway. 😁

@jpsim
Copy link
Collaborator

jpsim commented Jan 9, 2017

I gave you write access in case that helps moving forward.

esad and others added 5 commits January 9, 2017 17:54
Fixes from add finishing touches to PSPDFKit-search:

* Fix rubocop issues
* Add changelog entry
* Remove unused tempfile entry
* Change --searchable to --unsearchable
@jpsim
Copy link
Collaborator

jpsim commented Jan 10, 2017

You got so close! Will finish finishing this finishment in #725.

@jpsim jpsim closed this Jan 10, 2017
@1ec5 1ec5 deleted the finish-pspdfkit-labs-search branch January 11, 2017 08:39
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.

8 participants