Skip to content

[Feature Request]: Don't always show "edit this page" for private repos #1059

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

Open
2 tasks done
shainaraskas opened this issue Apr 8, 2025 · 1 comment
Open
2 tasks done

Comments

@shainaraskas
Copy link
Contributor

shainaraskas commented Apr 8, 2025

Prerequisites

  • I have searched existing issues to ensure this feature hasn't already been requested
  • I have tested using the latest version of docs-builder

What problem are you trying to solve?

In the asciidoc system, we don't show "edit" buttons in our cloud books (e.g. cloud or cloud enterprise) because the repo is private. instead, we add a query param to the url to expose the edit option: ?edit

because we have content coming from private repos in the v3 system, we should similarly hide the Edit this page option on pages that external contributors can't edit, but also make some sort of way to unhide it for elasticians.

If we don't do this, external contributors will see an ugly github error page, which might feel broken, or dissuade them from contributing elsewhere

Proposed Solution

probably use the query param again because people are used to it: ?edit

use the query param to dynamically show/hide the edit button

consider storing some sort of cookie so editing is always on for these users?

Examples and Research

No response

Alternative Solutions

anything else that hides the button and conditionally shows it to elastic users works for me

Additional Context

No response

How important is this feature to you?

Important

@reakaleek reakaleek self-assigned this Apr 11, 2025
@reakaleek
Copy link
Member

reakaleek commented Apr 14, 2025

My quick script to check for github repo visibility shows only 2 private repositories.
I got the repositories from the assembler.yml

repo visibility
Checking elastic/apm-server... PUBLIC
Checking elastic/apm-agent-android... PUBLIC
Checking elastic/apm-agent-dotnet... PUBLIC
Checking elastic/apm-agent-go... PUBLIC
Checking elastic/apm-agent-ios... PUBLIC
Checking elastic/apm-agent-java... PUBLIC
Checking elastic/apm-agent-nodejs... PUBLIC
Checking elastic/apm-agent-php... PUBLIC
Checking elastic/apm-agent-python... PUBLIC
Checking elastic/apm-agent-ruby... PUBLIC
Checking elastic/apm-agent-rum-js... PUBLIC
Checking elastic/apm-aws-lambda... PUBLIC
Checking elastic/apm-k8s-attacher... PUBLIC
Checking elastic/beats... PUBLIC
Checking elastic/cloud-on-k8s... PUBLIC
Checking elastic/cloud... PRIVATE
Checking elastic/curator... PUBLIC
Checking elastic/detection-rules... PUBLIC
Checking elastic/ecctl... PUBLIC
Checking elastic/ecs-dotnet... PUBLIC
Checking elastic/ecs-logging-go-logrus... PUBLIC
Checking elastic/ecs-logging-go-zap... PUBLIC
Checking elastic/ecs-logging-go-zerolog... PUBLIC
Checking elastic/ecs-logging-java... PUBLIC
Checking elastic/ecs-logging-nodejs... PUBLIC
Checking elastic/ecs-logging-php... PUBLIC
Checking elastic/ecs-logging-python... PUBLIC
Checking elastic/ecs-logging-ruby... PUBLIC
Checking elastic/ecs-logging... PUBLIC
Checking elastic/ecs... PUBLIC
Checking elastic/eland... PUBLIC
Checking elastic/elastic-serverless-forwarder... PUBLIC
Checking elastic/elasticsearch-hadoop... PUBLIC
Checking elastic/elasticsearch-java... PUBLIC
Checking elastic/elasticsearch-js... PUBLIC
Checking elastic/elasticsearch-net... PUBLIC
Checking elastic/elasticsearch-php... PUBLIC
Checking elastic/elasticsearch-py... PUBLIC
Checking elastic/elasticsearch-rs... PUBLIC
Checking elastic/elasticsearch-ruby... PUBLIC
Checking elastic/elasticsearch... PUBLIC
Checking elastic/go-elasticsearch... PUBLIC
Checking elastic/integrations... PUBLIC
Checking elastic/kibana... PUBLIC
Checking elastic/logstash-docs-md... PUBLIC
Checking elastic/logstash... PUBLIC
Checking elastic/search-ui... PUBLIC
Checking elastic/integration-docs... PRIVATE

I don't think this is something the changes frequently and I don't think it's worth doing an GH API call every time to determine the repo visiblity.

Hence, I will just add a new property to the either to assembler config or docset... something like private: true that will be used to show the link or not.

After looking at the list of repositories this will be added for:

  • elastic/cloud
  • elastic/integration-docs

@reakaleek reakaleek removed their assignment Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants