-
Notifications
You must be signed in to change notification settings - Fork 656
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
Added regex matching github.company.com #938
Conversation
@MitchDizzle thank you for reaching out to us with this pr. =) @silverwind or @Mottie will be better people to check the merits of this enhancement, atm though enterprise users are required to add their domain to GHD, which has to be done after each style update. I think it would be nice to have this just work out-of-the-box, though Im ot sure if thers a particular reason why it is like it is atm. Thanks again, and lest wait for some feedback/action. |
I think there is a few things to be concerned about also, like I noticed GitHub Enterprise instances could possibly differ on versions of the public github domain. |
I think if theres any other issues, they need to be properly elaborated and documented, I dont think any of us (I dont anyway) have an Enterprise account to go and test/fix or anything of the kind. |
Does Stylus allow user-defined include/exclude without breaking the auto-update? Would prefer the user to define their domain name instead of matching |
Fair point, I don't know too much about stylus or how the style overriding works, but if there is an easier solution that translates to potentially all the stylus styles then I'm all for it. |
Not that I'm aware of. When I add an extra domain to the GHD style and then try to update it prompts me about my local changes being over written. Are we able to add a configurable value to the domain list and just default it to |
Looks like you can add a configurable value to the domain list. At least in my quick test it just worked. |
Mind showing where? I looked through the Stylus extension and couldn't figure out how to add domains unless editing the .css manually edit: oh i see having it as an option to and adding the option to the domain regex? |
So this does work after all. I needed to fully close out of Stylus for it to take effect. Here's my change to prove it worked: } EOT;
}
+@advanced text ghe-domain "GitHub Enterprise Domain" "github.com"
==/UserStyle== */
@-moz-document
regexp("^https?://((gist|guides|help|launch-editor|raw|resources|status|developer)\\.)?github\\.com/((?!generated_pages/preview).)*$"),
domain("githubusercontent.com"),
domain("graphql-explorer.githubapp.com"),
+domain("/*[[ghe-domain]]*/") {
/*! Github Dark v1.21.46 (2019-04-29) */ |
Why is google showing GHD active? |
@xt0rted nice find, we can use this until openstyles/stylus#708 is resolved. |
@MitchDizzle I think my issue was I needed to close out of the style editor for the domain change to be picked up. Usually style changes take effect immediately, but the document rule didn't seem to. Something else I was thinking about was in addition to publishing |
Not a fan of publishing a second file, it's extra maintenance burden. |
I've been wishing for support of this kind for many many years now! I agree it's important to be able to opt out of auto-updates because even a bleeding edge GHE version is often behind live github styles for weeks or months at a time. I think there might be a better approach than publishing a second file: have a designated custom build script specifically for GHE users to build their own custom file that they can update in tandem with their internal GHE version. Ideally the build would:
|
May be something that can only be supported in the script version. I could even see a a dropdown that lets the user switch between different versions of GHD in case thei GHE installation is older. |
Hoping to bring the PR back to life here... I tried @xt0rted 's recommendation of modifying that section of code as follows: } EOT;
}
+ @advanced text ghe-domain "GitHub Enterprise Domain" "github.com"
==/UserStyle== */
@-moz-document
regexp("^https?://((gist|guides|help|launch-editor|raw|resources|status|developer)\\.)?github\\.com/((?!generated_pages/preview).)*$"),
domain("githubusercontent.com"),
domain("graphql-explorer.githubapp.com"),
+ domain("/*[[ghe-domain]]*/") {
/*! Github Dark v1.21.46 (2019-04-29) */ This also works, and it's even better because it's so much easier to add the new domain using the Stylus plugin. Yes, you have to restart Firefox for it to fully work. Now, my guess is that the same thing's going to happen, my changes will get overwritten and I'll be back to square one. So, can we get this diff in? |
@LunaticoCR Thats what I was thinking about. I agree that solution is more ideal than current, it would survive updates, and what you experience now is updates which must be forced due to local edits take precedence, does wipe local additions out. So here s my +1 for that solution. The alternative is a fork + these additions that you keep rebased and update from the fork thus also needing to change usercss metadata withing the build tools. Thats always an alternative, to waiting until the eventual day it gets added, I guess. |
But if the project owners agree we can just add it now right? I'm going to assume the top contributors own it so I'll mention them here: @silverwind @Mottie @the-j0k3r @xt0rted So we can open a new PR for this, the change would be just on the usercss. I don't mind opening the PR myself if you prefer? Although the rightful author is @xt0rted , but I can always mention you and give you all the credit. Let me know what you guys think. |
To me I would merge such PR immediately,, thought its not just up to me =) Add a new PR that also included on the issue description |
I think even that is overengineered. A simple Note that @LunaticoCR's suggestion won't work as expected - the regex is clearly intended to not match the entire github.com domain. |
That's the wrong assumption, the GHE I work on is not on a github subdomain. I bet most GHE installations for big companies are on their own domains.
What regex? It's just taking a user provided string from the stylus plugin and using that as is, as an allowed domain. Unless I'm missing something? |
Counterpoints: the OP's GitHub Enterprise is on a
The existing document regex. |
I wouldnt know, but to be sure one would have to know actual examples and what formats they use and if the proposed solution accommodates the most actual cases. |
Thanks for the explanation @xt0rted , I see your point. |
I would say if any of the given custom solutions solve the most cases reported here, go with that. Its a start. |
Yes, this is true, there are two supported configurations each for Gist and Pages in GHE. I would personally wager that there are more GHE installs with Gist and Pages on subdomains, but there's no way to actually get stats on that. Given that |
See #973 feature request for a format that would need to be accounted here, I think. |
Thinking about this.... does anyone know if it's possible to insert a variable in the middle of a regex? |
It won't work. Stylus doesn't work exactly as expected, but I opened an issue where we could discuss this problem. |
That's great, thanks for opening that issue @Mottie ! |
98f96ae
to
793fb7a
Compare
f5090f7
to
c4c63b4
Compare
Hit_****_ |
@arizaju12 read #938 (comment) |
This PR seems like the wrong approach but I could see us adding a |
Closing this as it's not the right approach. Follow the issue #1086 instead. |
Updated github-dark to match my company's enterprise domain which looks like "github.company.com"
I'm not sure how to provide evidence that this works other than my word, I found this style and when I installed it initially did not work for my company's external domain, after this little bit of regex addition it started to work on both normal GitHub and GitHub Enterprise.
Sorry If I didn't conform to any of the contributing steps, it seems they may have been more directed at creating new styles or something?