rubocop / rubocop-rspec

Code style checking for RSpec files.
https://docs.rubocop.org/rubocop-rspec
MIT License
795 stars 272 forks source link

Documentation #972

Open bquorning opened 4 years ago

bquorning commented 4 years ago

I noticed that @bbatsov added three commits, adding some AsciiDoc documentation:

I cannot find any related PRs, so probably they were pushed directly to master (please don’t do that again 😄).

It seems we now have almost identical documents in manual/ and docs/ folders, but only the former is getting updated. What’s the plan? Should we change our documentation Rake task to update docs/ and delete the manual/ folder?

bquorning commented 4 years ago

I am asking party because I want to turn cops_documentation.rake into a class instead having all the code inside a Rake task, and that almost identical code exists in rubocop, rubocop-rails, and rubocop-performance, and I imagine rubocop-rake has, or would benefit from having, similar code.

pirj commented 4 years ago

That would be great to unify doc tasks with other repos. Since it's docs/ that get deployed to https://docs.rubocop.org/rubocop-rspec/, I guess we can retire manual/.

We still have a link in gemspec that points to https://rubocop.readthedocs.io/projects/rspec/en/latest/ though. Frankly, I have little to no idea how this documentation gets its way there. Somehow via a hook that uses mkdocs.yml?

https://www.rubydoc.info/find/github?q=rubocop-rspec returns 404. I remember @lsegal and @ioquatix maintain some other doc site, but can't quickly find it. Anyway, it seems rather unrelated, as such sites parse the code using class docs.

bquorning commented 4 years ago

Frankly, I have little to no idea how this documentation gets its way there. Somehow via a hook that uses mkdocs.yml?

I think #558 holds the answers to that question.

bbatsov commented 4 years ago

I'm surprised nobody noticed this so long, as we moved all the documentation about core RuboCop plugins to AsciiDoc/Antora recently. I even opened https://github.com/rubocop-hq/rubocop-rspec/issues/922 about the final missing point and I then I ran out of time for this.

Since it's docs/ that get deployed to https://docs.rubocop.org/rubocop-rspec/, I guess we can retire manual/.

Yep. There's one more thing to do, though - setting redirects from RTD to the new URLs. That's done from the admin UI.

I am asking party because I want to turn cops_documentation.rake into a class instead having all the code inside a Rake task, and that almost identical code exists in rubocop, rubocop-rails, and rubocop-performance, and I imagine rubocop-rake has, or would benefit from having, similar code.

Yeah, it'd be nice to dedup this. There's a lot of repetition in the maintenance code.

I cannot find any related PRs, so probably they were pushed directly to master (please don’t do that again smile).

Sorry about that. I was under the impression everyone new about this, as I recall it was discussed somewhere else. I guess I was wrong. :smile: The migration was done automatically, so there wasn't much to review there.

bquorning commented 4 years ago

Yep. There's one more thing to do, though - setting redirects from RTD to the new URLs. That's done from the admin UI.

I’m pretty sure I don’t have admin access at RTD. Maybe @bbatsov or @Darhazer has?

Sorry about that. I was under the impression everyone new about this, as I recall it was discussed somewhere else. I guess I was wrong. 😄

I kinda knew that the md -> asciidoc conversion was happening, but I wasn’t sure about the state of things. And while I notice most PR’s, I didn’t notice you committing directly to the master branch :-)

And that said, I completely missed #922. Sorry about that.

Just a question: How do the files in docs/ get sync’ed to the documentation site?

bbatsov commented 4 years ago

Right now it's manual - https://docs.rubocop.org/rubocop/0.87/contributing.html#documentation

The new docs site pulls all documentation modules from all the repos and builds the combined site. The only thing to keep in mind is that antora.yml has to be updated when cutting releases and that new tags have to be added to the antora-playbook.yml in docs.rubocop.org repo. At some point I plan to automate this via GitHub actions, but I didn't have enough time to play with them.

bquorning commented 4 years ago

WIP at https://github.com/rubocop-hq/rubocop-rspec/compare/asciidoc-documentation – will create PR later.

bbatsov commented 4 years ago

Looks good!

bquorning commented 3 years ago

In the last RuboCop release, I see that antora.yml was changed right before the release, and again right after:

I am not sure if the docs upload/pull process was manual or automated.

koic commented 3 years ago

Hi, @bquorning

am not sure if the docs upload/pull process was manual or automated.

It is automated by the following repository. https://github.com/rubocop-hq/docs.rubocop.org

For the release of rubocop-rspec 1.43.0:

  1. Update docs/antora.yml in rubocop-rspec repository (from version: master to version: '1.43') [example]
  2. Release rubocop-rspec 1.43.0 (and git tagging)
  3. Switch back docs/antora.yml in rubocop-rspec repository (from version: '1.43' to version: master) [example]
  4. % cd docs.rubocop.org
  5. Add rubocop-rspec 1.43.0 version to antora-playbook.yml in docs.rubocop.org repository [example]
  6. Run $ antora --pull antora-playbook.yml
  7. Run $ ./deploy [script]

NOTE: no patch version is required for docs/antora.yml in rubocop-rspec repository. And specify the patch version in antora-playbook.yml in docs.rubocop.org repository.

If you have any questions, please ask me :-)

bbatsov commented 3 years ago

NOTE: no patch version is required for docs/antora.yml in rubocop-rspec repository.

Let me add a bit of detail here - I've opted not to include the patch version mostly to avoid publishing the same documentation twice (we should just use whatever the latest patch version is to publish the docs for a particular release).

bquorning commented 3 years ago

Is step 3 really necessary?

koic commented 3 years ago

Yep. I've once encountered this troubleshooting 😅 https://github.com/rubocop-hq/docs.rubocop.org#troubleshooting

bbatsov commented 3 years ago

You'd get an error from Antora saying that the same docs version exists in multiple branches if you don't do it. (as the version is the defined by antora.yml, not by the git branch version)

pirj commented 3 years ago

@bquorning Do you think there's anything actionable left here?

bquorning commented 3 years ago

I think we should add an “internal readme” with notes on the things to remember when deploying, including the notes from https://github.com/rubocop-hq/rubocop-rspec/issues/972#issuecomment-670306179