-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
6c4ece0
to
535a970
Compare
There was a problem hiding this 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/.
There was a problem hiding this 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' |
There was a problem hiding this comment.
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
:
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.
There was a problem hiding this 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' %> |
There was a problem hiding this comment.
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
?
<%= 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.
app/views/policies/index.html.erb
Outdated
@@ -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) |
There was a problem hiding this comment.
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
b363505
to
308ba42
Compare
@@ -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') %>. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
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.