Meta: Ability to remotely disable broken features - #3530
Conversation
cb65eb7 to
0acc631
Compare
resolves refined-github#3529 Signed-off-by: shine <[email protected]>
0acc631 to
a7cc2c8
Compare
To test this:
The feature
The feature Please ensure it works |
Co-authored-by: Federico <[email protected]>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: shine <[email protected]>
|
after multiple roadblocks and workarounds, I've finally managed to test the feature. my first issue was with Firefox not able to I realized this early ( during my Firefox testing itself when I over-rode the remote {"feature:cleanup-repo-filelist-actions": false, "unaffected": "20.9.4"}Disclaimer : I was only able to confirm that the JSON that is pulled from the remote file is appended to Also, I noticed that if PS : The lint check failing against my last commit 37646fd looks like a false positive. There is no double |
PR checks are tested against the "merge commit". This means that even if not visible, the actual file being tested was https://github.com/sindresorhus/refined-github/blob/817871850908ffa687b0b087d03199f5eed3c40e/source/background.ts#L1-L3 You can see that there are two imports, because one was recently added by 2dc5f26 Thankfully we have this feature to update the PR with those changes and fix them: https://github.com/sindresorhus/refined-github/blob/master/source/features/update-pr-from-base-branch.tsx |
|
I tested this and it works in Chrome, but not in Firefox: neither with We can't add You can use
I just updated the contents of hotfix.json now: https://github.com/sindresorhus/refined-github/blob/hotfix/hotfix.json |
were you testing with
Good catch. I'll use the
thanks. it'll make testing easier for me. |
Signed-off-by: shine <[email protected]>
|
Don’t call the API directly, we have the file const response = await api.v3('/repos/sindresorhus/refined-github/contents/hotfix.json?ref=hotfix');
const hotfixes = JSON.parse(atob(response.content)) |
Signed-off-by: shine <[email protected]>
|
@fregante would that cause issues when run on enterprise? |
|
I am always skeptical about I think it makes sense here since this is a web extension and it is only about DOM manipulation and Web APIs. Honestly, I did not see the edited comment and made the changes before I saw the edited comment. If you feel strongly about |
|
@yakov116 : I noticed this too when I was exploring with GitHub.com : with GitHub Enterprise : is this what you are talking about? or did I miss the point altogether? |
Yes |
Good catch. I wanted to use |
|
@fregante I think having an enterprise token will make an issue. Since it includes the token if it exists. I tried to put in an invalid token and I got refined-github.js:19790 Uncaught (in promise) Error: The token seems to be incorrect or expired. Update it in the options.
at getError (refined-github.js:19892)
at async Module../source/github-helpers/api.ts.mem__WEBPACK_IMPORTED_MODULE_0___default.cacheKey (refined-github.js:19842)
at async ./source/features/index.tsx.webext_storage_cache__WEBPACK_IMPORTED_MODULE_1__.default.function.maxAge.seconds (refined-github.js:12131)
at async getSet (refined-github.js:6490) |
|
I tried using api.ts to possibly use the token when making the call, but every “automatic” part comes back to bite us in this case. Let’s revert to fetch. |
|
Put in the lint pr? |
|
please let me know if I can to help here. does this only involve changing the |
const request = await fetch('https://api.github.com/repos/sindresorhus/refined-github/contents/hotfix.json?ref=hotfix');
const response = JSON.parse(await request.text());
const hotfixes: AnyObject | false = JSON.parse(atob(response.content));You can send a pr. This should be the code. |
according to refined-github#3530 (comment) Signed-off-by: shine <[email protected]>
according to refined-github#3530 (comment) Signed-off-by: shine <[email protected]>
Closes #3529.
hotfix.jsonhas been added to the repository tree toindicate the existence of the file in the repository. I have
set the value to
{ false }for now, but if that mightintroduce confusion to contributors, we could delete the file
altogether.
Note : since this is a background feature, I couldn't figure
out a way to test these changes.