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

Fixes #36838 - Make doc links point to the new docs #547

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

adamruzicka
Copy link
Contributor

@adamruzicka adamruzicka commented Oct 17, 2023

I know this isn't exactly clean, but this should get cherrypicked all the way back into a 3.6-compatible branch so we can't really add some nice infrastructure into Foreman itself and then use it here without making things hard for ourselves.

@adamruzicka adamruzicka marked this pull request as ready for review October 17, 2023 13:32
Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

Thanks, @adamruzicka, LGTM and works, but needs a small fix, see inline. It seems we don't need to explicitly mention el for https://docs.theforeman.org/.

app/helpers/foreman_openscap_helper.rb Outdated Show resolved Hide resolved
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I'd imagine this also needs changes in foreman_theme_satellite, but looking at https://github.com/RedHatSatellite/foreman_theme_satellite/blob/develop/lib/foreman_theme_satellite/documentation.rb (so happy that it's public now) I don't see it, so perhaps downstream also linked to unbranded docs.

@@ -15,10 +15,15 @@ def scap_doc_url(section = '')
documentation_url(section, root_url: scap_root_url)
end

def doc_flavor
ForemanOpenscap.with_katello? ? 'katello' : 'foreman-el'
Copy link
Member

Choose a reason for hiding this comment

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

My biggest concern is that the OpenSCAP guide is not published in stable branches as foreman-el:

https://github.com/theforeman/foreman-documentation/blob/5a811af4a30310b96a15e3bec708079e04256c31/guides/doc-Managing_Security_Compliance/master.adoc#L14-L18

This results in linking to https://docs.theforeman.org/3.8/Managing_Security_Compliance/index-foreman-el.html (for Foreman 3.8).

This is because it hasn't been properly reviewed. You can see examples such as https://docs.theforeman.org/nightly/Managing_Security_Compliance/index-foreman-el.html#Deploying_a_Policy_in_a_Host_Group_Using_Ansible_security-compliance

You have enabled and synced the operating system repositories to Foreman, and enabled them on the hosts:

Content syncing is not available without Foreman, so that needs to be addressed.

We do publish the nightly docs, just so you can at least review some of it, even if it's broken.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I think app/views/policies/steps/_deployment_options_form.html.erb is still the old link:

$ rg scap_doc_link
app/views/policies/steps/_deployment_options_form.html.erb
7:    <%= _('Please make sure you understand them by reading our') %> <%=scap_doc_link('#2.3Policydeploymentoptions') %>.

app/helpers/foreman_openscap_helper.rb
4:  def scap_doc_link(section = '', text = _('documentation'))

I'd consider making scap_doc_link more flexible or dropping it.

@@ -9,6 +9,6 @@
<%= _("You don't seem to have any ARF report. ARF report is a summary of a single scan occurrence on a particular host for a given Compliance Policy.") %></br>
</p>
<div class="blank-slate-pf-main-action">
<%= link_to _('Documentation'), documentation_url("4.4ARFReports", :root_url => "https://www.theforeman.org/plugins/foreman_openscap/0.8/index.html#"), :rel => 'external', :class => 'btn btn-primary btn-lg' %>
<%= link_to _('Documentation'), documentation_url("Monitoring_Compliance_security-compliance", :root_url => scap_doc_url), :rel => 'external', :class => 'btn btn-primary btn-lg' %>
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this use scap_doc_url?

Suggested change
<%= link_to _('Documentation'), documentation_url("Monitoring_Compliance_security-compliance", :root_url => scap_doc_url), :rel => 'external', :class => 'btn btn-primary btn-lg' %>
<%= link_to _('Documentation'), scap_doc_url("Monitoring_Compliance_security-compliance"), :rel => 'external', :class => 'btn btn-primary btn-lg' %>

For a moment I thought about using scap_doc_link but that looks to be not flexible enough.

@@ -3,7 +3,7 @@

<% title_actions(
display_link_if_authorized(_("New Compliance Policy"), hash_for_new_policy_path, :class => "btn btn-primary"),
documentation_button('#4.2Creatingpolicywizard', :root_url => scap_doc_url)
documentation_button('Managing_Compliance_Policies_security-compliance', :root_url => scap_doc_url)
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to create scap_documentation_button for now?

and rely on openscap helpers more
@@ -4,7 +4,7 @@
<div class="alert alert-info" id="scap-deployment-options-info-banner">
<span class="pficon pficon-info"></span>
<strong><%= _('There are significant differences in deployment options.') %></strong>
<%= _('Please make sure you understand them by reading our') %> <%=scap_doc_link('#2.3Policydeploymentoptions') %>.
<%= _('Please make sure you understand them by reading our') %> <%= link_to(_('documentation'), scap_doc_url('deploying-compliance-policies_security-compliance'), :rel => 'external noopener noreferrer', :target => '_blank') %>.
Copy link
Member

Choose a reason for hiding this comment

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

Translation wise this isn't great. Other languages may put the word documentation at another place, but perhaps we should track it elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

Thanks, @adamruzicka and @ekohl!

Sorry for waiting, LGTM, let's get this in.

@ofedoren ofedoren merged commit 00db90f into theforeman:master Oct 31, 2023
2 of 4 checks passed
@adamruzicka adamruzicka deleted the doc-links branch October 31, 2023 13:53
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.

3 participants