Skip to content

Commit b1a30f8

Browse files
authored
Merge branch 'master' into preempt
2 parents 8653758 + 83dcdd2 commit b1a30f8

29 files changed

+769
-886
lines changed

.github/dependabot.yml

-6
This file was deleted.

.github/labels.yml

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
- modules/twinklexfd.js
4242
Tests:
4343
- tests/*
44-
- scripts/patch-test.js
45-
- scripts/server.js
4644
Docs:
4745
- "*.md"
4846
Gadget:

.github/workflows/codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
# Initializes the CodeQL tools for scanning.
3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v1
37+
uses: github/codeql-action/init@v3
3838
with:
3939
languages: ${{ matrix.language }}
4040
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -45,7 +45,7 @@ jobs:
4545
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4646
# If this step fails, then you should remove it and run the build manually (see below)
4747
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v1
48+
uses: github/codeql-action/autobuild@v3
4949

5050
# ℹ️ Command-line programs to run using the OS shell.
5151
# 📚 https://git.io/JvXDl
@@ -59,4 +59,4 @@ jobs:
5959
# make release
6060

6161
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v1
62+
uses: github/codeql-action/analyze@v3

DEVELOPER.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Things to watch out for:
88

99
- Items and processes laid out in [CONTRIBUTING.md](./CONTRIBUTING.md) are followed.
1010
- Twinkle is meant to run on the latest weekly version of MediaWiki as rolled out every Thursday on the English Wikipedia. Backwards compatibility is not guaranteed.
11-
- The goal is for Twinkle and Morebits to support the same [browsers for which MediaWiki provides Grade A support](https://www.mediawiki.org/wiki/Browser_compatibility), except IE 11. The Twinkle gadget on enwiki is configured so that we can use up to JavaScript version ES6. However, due to the MediaWiki minifier, we must not use keywords from ES2016 or later, such as async/await and RegEx /s flag. New functions from ES2016 or later, such as Array.includes() should be okay since these will not break the minifier.
11+
- The goal is for Twinkle and Morebits to support the same [browsers for which MediaWiki provides Grade A support](https://www.mediawiki.org/wiki/Browser_compatibility). The Twinkle gadget on enwiki is configured so that we can use up to JavaScript version ES6. However, due to the MediaWiki minifier, we must not use keywords from ES2016 or later, such as async/await and RegEx /s flag. New functions from ES2016 or later, such as Array.includes() should be okay since these will not break the minifier.
1212
- Certain positional jQuery selectors like `:first`, `:last`, and `:eq` were [deprecated in jQuery version 3.4.0](https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/) and should probably not be reintroduced. Instead, use methods like `.first()`, `.last()`, or `.eq()`.
1313

1414
## Updating scripts on Wikipedia
1515

1616
There are two ways to upload Twinkle scripts to Wikipedia or another destination. You can do it with a [Perl script](#synchronization-using-syncpl) (recommended) or [manually](#manual-synchronization).
1717

18-
After the files are synced, ensure that [MediaWiki:Gadgets-definition][] contains the gadget definition found in [gadget.txt](./gadget.txt) (`sync.pl` will report its status). In addition to the `Twinkle` definition, the gadget installs the `morebits` library as a hidden gadget, making it efficiently available for other tools to use. `Twinkle-pagestyles` is a hidden [peer gadget](https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#Gadget_peers) of Twinkle. Before Twinkle has loaded, it adds space where the TW menu would go in the Vector skin, so that the top bar does not "jump".
18+
After the files are synced, ensure that [MediaWiki:Gadgets-definition][] contains the gadget definition found in [gadget.txt](./gadget.txt) (`deploy.pl` will report its status). In addition to the `Twinkle` definition, the gadget installs the `morebits` library as a hidden gadget, making it efficiently available for other tools to use. `Twinkle-pagestyles` is a hidden [peer gadget](https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#Gadget_peers) of Twinkle. Before Twinkle has loaded, it adds space where the TW menu would go in the Vector skin, so that the top bar does not "jump".
1919

2020
[select2][] is also uploaded as a hidden gadget for better menus and to take advantage of the Resource Loader over the [Toolforge CDN](https://tools.wmflabs.org/cdnjs/); it is done so under the [MIT license](https://github.com/select2/select2/blob/develop/LICENSE.md). Loading via the ResourceLoader causes it to register as a nodejs/commonjs environment with `module.exports`, so a slight tweak has been made, eliminating that check. Ideally, this will be handled differently (see [external libraries](https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers#Special_case_of_external_libraries) and [T108655](https://phabricator.wikimedia.org/T108655). As such, be careful when updating select2 from upstream.
2121

@@ -51,9 +51,9 @@ Each Twinkle module and dependency lives on the wiki as a separate file. The lis
5151
- `modules/friendlytalkback.js` → [MediaWiki:Gadget-friendlytalkback.js][]
5252
- `modules/twinkleblock.js` → [MediaWiki:Gadget-twinkleblock.js][]
5353

54-
### Synchronization using `sync.pl`
54+
### Synchronization using `deploy.pl`
5555

56-
There is a synchronization script called `sync.pl`, which can be used to deploy updates to on-wiki gadgets, or update the repository based on on-wiki changes. For full details, run `perl sync.pl --help`.
56+
There is a synchronization script called `deploy.pl`, which can be used to deploy updates to on-wiki gadgets, or update the repository based on on-wiki changes. For full details, run `perl deploy.pl --help`.
5757

5858
The program depends on a few Perl modules, namely [`MediaWiki::API`][MediaWiki::API], [`Git::Repository`][Git::Repository], [`File::Slurper`][File::Slurper], and [`Config::General`][Config::General]. These can be installed easily using [`App::cpanminus`][App::cpanminus]:
5959

@@ -75,25 +75,25 @@ When running the program, you can enter your credentials on the command line usi
7575

7676
Using the `deploy` mode, [interface-admins][intadmin] can deploy Twinkle files live to their MediaWiki:Gadget locations. You will need to set up a bot password at [Special:BotPasswords][special_botpass].
7777

78-
sync.pl --mode=deploy twinkle.js morebits.js ...
78+
deploy.pl --mode=deploy twinkle.js morebits.js ...
7979

8080
If no files are provided, it will just report the status of the gadget. You may also `deploy` **all** files via
8181

82-
sync.pl --mode=deploy --all
82+
deploy.pl --mode=deploy --all
8383

84-
Note that for syncing to a non-Enwiki project, you will also need to specify the --lang and/or --family parameters. For instance, to sync the files with `fr.wikiquote.org` you should specify `--lang=fr --family=wikiquote`, such as
84+
Note that for syncing to a non-Enwiki project, you will also need to specify the --lang and/or --family parameters. For instance, to deploy to `fr.wikiquote.org` you should specify `--lang=fr --family=wikiquote`, such as
8585

86-
sync.pl --mode=deploy --lang=fr --family=wikiquote --all
86+
deploy.pl --mode=deploy --lang=fr --family=wikiquote --all
8787

8888
When `deploy`ing or `push`ing, the script will attempt to parse the latest on-wiki edit summary for the commit of the last update, and will use that to create an edit summary using the changes committed since then. If it cannot find anything that looks like a commit hash, it will give you the most recent commits for each file and prompt you to enter an edit summary manually.
8989

9090
To `pull` user Foobar's changes (i.e. `User:Foobar/morebits.js`) down from the wiki, do:
9191

92-
sync.pl --base User:Foobar/ --mode=pull twinkle.js morebits.js ...
92+
deploy.pl --base User:Foobar/ --mode=pull twinkle.js morebits.js ...
9393

9494
To `push` your changes to user Foobar's wiki page, do:
9595

96-
sync.pl --base User:Foobar/ --mode=push twinkle.js morebits.js ...
96+
deploy.pl --base User:Foobar/ --mode=push twinkle.js morebits.js ...
9797

9898
The `--base` flag operates as a *prefix*; note the presence of the trailing `/`.
9999

@@ -136,7 +136,7 @@ The `--base` flag operates as a *prefix*; note the presence of the trailing `/`.
136136

137137
#### Work instruction
138138

139-
If you are an interface admin on English Wikipedia and you want to deploy Twinkle's master branch, and you aren't interested in sync.pl's fancy options, here's a simple work instruction. Don't forget to change the username and password.
139+
If you are an interface admin on English Wikipedia and you want to deploy Twinkle's master branch, and you aren't interested in deploy.pl's fancy options, here's a simple work instruction. Don't forget to change the username and password.
140140

141141
Microsoft Windows:
142142
```
@@ -163,19 +163,20 @@ Every time:
163163
- In your browser, go to GitHub, go to your Twinkle fork, and check if it says it is out of date. If so, click "Sync fork"
164164
- `git pull`
165165
- `cd scripts`
166-
- `perl sync.pl --mode=deploy --all`
166+
- `perl deploy.pl --mode=deploy --all`
167167
- it'll ask yes/no. type y
168168
- if it prompts you for any edit summaries, just hit enter to skip
169169
- there will be lots of "Warning: unable to close filehandle" messages, and some other problems such as displaying ←[0m←[96m for line breaks. you can ignore these. shouldn't be a problem.
170170
```
171171

172172
### Dependencies
173173

174-
All the dependencies that Twinkle uses are JavaScript **dev** dependencies. They are not used at all on-wiki and are just used during development. Here's what they are and what they do. This may help with evaluating dependabot patches (dependabot is a GitHub bot that helps keep libraries up to date by submitting pull requests).
174+
All the dependencies that Twinkle uses are JavaScript **dev** dependencies. They are not used at all on-wiki and are just used during development. Here's what they are and what they do.
175175

176176
- eslint - Used by continuous integration for enforcing code linting rules.
177177
- jest - Used by continuous integration for unit testing.
178178
- jest-environment-jsdom - Needed for Jest to work.
179179
- mock-mediawiki - Used by continuous integration for unit testing.
180180
- mwn - Used when you run `npm start`. `npm start` is what enables localhost testing.
181-
- Everything else - Dependabot will not usually try to update these unless one of the 5 above dependencies gets out of date. It is probably best to update the above dependencies instead.
181+
182+
When updating dependencies, CI should take care of testing most of that. Manually testing `npm start` should be the only additional check needed.

SECURITY.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Although rare, we take security bugs in Twinkle seriously.
44

5-
If you believe you have found a security issue, please **privately** contact one or both of the currently-active maintainers:
5+
If you believe you have found a security issue, please **privately** contact one or both of the currently active maintainers:
66

7-
* @Amorymeltzer: [Email](https://en.wikipedia.org/wiki/Special:EmailUser/Amorymeltzer)
8-
* @MusikAnimal: [Email](https://en.wikipedia.org/wiki/Special:EmailUser/MusikAnimal)
7+
* @siddharthvp: [Email](https://en.wikipedia.org/wiki/Special:EmailUser/SD0001)
8+
* @NovemLinguae: [Email](https://en.wikipedia.org/wiki/Special:EmailUser/Novem_Linguae)
99

10-
Please include "Twinkle Security" in the subject line and include as much information in the body as you are capable of providing. We will respond as quickly as we are able with further steps.
10+
Please include "Twinkle Security" in the subject line and include as much information in the body as you are capable of providing. We will respond as quickly as we are able with further steps.
1111

12-
If one of use doesn't respond in a timely fashion, you can try to [contact another interface-admin](https://en.wikipedia.org/wiki/Special:ActiveUsers?groups=interface-admin&excludegroups=bot) with the same information.
12+
If one of us doesn't respond in a timely fashion, you can try to [contact another interface-admin](https://en.wikipedia.org/wiki/Special:ActiveUsers?groups=interface-admin&excludegroups=bot) with the same information.

gadget.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Twinkle[ResourceLoader|dependencies=ext.gadget.morebits,ext.gadget.select2,mediawiki.api,mediawiki.language|rights=autoconfirmed|type=general|peers=Twinkle-pagestyles|requiresES6]|Twinkle.js|Twinkle.css|twinklearv.js|twinklewarn.js|twinkleblock.js|friendlywelcome.js|friendlyshared.js|friendlytalkback.js|twinklespeedy.js|twinkleprod.js|twinklexfd.js|twinkleimage.js|twinkleprotect.js|friendlytag.js|twinklediff.js|twinkleunlink.js|twinklefluff.js|twinkledeprod.js|twinklebatchdelete.js|twinklebatchprotect.js|twinklebatchundelete.js|twinkleconfig.js
2-
* morebits[ResourceLoader|dependencies=mediawiki.user,mediawiki.util,mediawiki.Title,jquery.ui|hidden|requiresES6]|morebits.js|morebits.css
3-
* Twinkle-pagestyles[hidden|skins=vector,vector-2022]|Twinkle-pagestyles.css
4-
* select2[ResourceLoader|hidden]|select2.min.js|select2.min.css
1+
* Twinkle [ResourceLoader |dependencies=ext.gadget.morebits, ext.gadget.select2, mediawiki.api, mediawiki.language |rights=autoconfirmed |type=general |peers=Twinkle-pagestyles |requiresES6] |Twinkle.js |Twinkle.css |twinklearv.js |twinklewarn.js |twinkleblock.js |friendlywelcome.js |friendlyshared.js |friendlytalkback.js |twinklespeedy.js |twinkleprod.js |twinklexfd.js |twinkleimage.js |twinkleprotect.js |friendlytag.js |twinklediff.js |twinkleunlink.js |twinklefluff.js |twinkledeprod.js |twinklebatchdelete.js |twinklebatchprotect.js |twinklebatchundelete.js |twinkleconfig.js
2+
* morebits [ResourceLoader |dependencies=mediawiki.user, mediawiki.util, mediawiki.Title, jquery.ui |hidden |requiresES6] |morebits.js |morebits.css
3+
* Twinkle-pagestyles [hidden |skins=vector, vector-2022] |Twinkle-pagestyles.css
4+
* select2 [ResourceLoader |hidden] |select2.min.js |select2.min.css

0 commit comments

Comments
 (0)