volunteer-contributions-fetch 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "airbnb-base",
2
+ "extends": ["airbnb-base", "plugin:prettier/recommended"],
3
3
  "settings": {
4
4
  "import/resolver": {
5
5
  "node": {
@@ -9,8 +9,8 @@ jobs:
9
9
  release:
10
10
  runs-on: ubuntu-22.04
11
11
  steps:
12
- - uses: actions/checkout@9a3a9ade8222dcdf9d3c77710b10df47ee7c7c89
13
- - uses: actions/setup-node@v1
12
+ - uses: actions/checkout@v3
13
+ - uses: actions/setup-node@v3
14
14
  with:
15
15
  node-version: 16
16
16
  - run: npm ci
@@ -6,16 +6,16 @@ jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@9a3a9ade8222dcdf9d3c77710b10df47ee7c7c89
10
- with:
11
- submodules: 'recursive'
12
- - name: Use Node.js 16
13
- uses: actions/setup-node@v1
14
- with:
15
- node-version: 16
16
- - name: Install Dependencies
17
- run: npm ci
18
- - name: Linting
19
- run: npm run eslint
20
- - name: Test
21
- run: npm test
9
+ - uses: actions/checkout@v3
10
+ with:
11
+ submodules: 'recursive'
12
+ - name: Use Node.js 16
13
+ uses: actions/setup-node@v3
14
+ with:
15
+ node-version: 16
16
+ - name: Install Dependencies
17
+ run: npm ci
18
+ - name: Linting
19
+ run: npm run eslint
20
+ - name: Test
21
+ run: npm test
@@ -0,0 +1,4 @@
1
+ node_modules
2
+
3
+ /coverage
4
+ /.nyc_output
package/README.md CHANGED
@@ -8,22 +8,22 @@ This library fetches contributions from several different sources and saves them
8
8
 
9
9
  Currently the following sources are supported. Feel free to contribute a PR if you'd like to support another source!
10
10
 
11
- * GitHub
12
- * Issues created
13
- * Comments on issues
14
- * PRs
15
- * PR Reviews
16
- * Bugzilla
17
- * Bug reported
18
- * Bug commented on
19
- * MediaWiki
20
- * Page edited
21
- * Discourse
22
- * Topic created
23
- * Post created
24
- * Mozilla Community Portal
25
- * Participated in event
26
- * Participated in campaign
11
+ - GitHub
12
+ - Issues created
13
+ - Comments on issues
14
+ - PRs
15
+ - PR Reviews
16
+ - Bugzilla
17
+ - Bug reported
18
+ - Bug commented on
19
+ - MediaWiki
20
+ - Page edited
21
+ - Discourse
22
+ - Topic created
23
+ - Post created
24
+ - Mozilla Community Portal
25
+ - Participated in event
26
+ - Participated in campaign
27
27
 
28
28
  Each of the sources can be enabled separately. See the configuration section below.
29
29
 
@@ -31,16 +31,16 @@ Each of the sources can be enabled separately. See the configuration section bel
31
31
 
32
32
  The following sources are planned:
33
33
 
34
- * Phabricator
35
- * Revision created
36
- * Revision updated
34
+ - Phabricator
35
+ - Revision created
36
+ - Revision updated
37
37
 
38
38
  ### Possible future sources
39
39
 
40
40
  The following sources would be interesting for (at least) Mozilla contributors, however they do not expose an activity API endpoint to easily gather information for a certain user.
41
41
 
42
- * support.mozilla.org
43
- * Pontoon
42
+ - support.mozilla.org
43
+ - Pontoon
44
44
 
45
45
  ## Usage
46
46
 
@@ -66,7 +66,7 @@ You can configure the different providers with a config you pass into the `fetch
66
66
 
67
67
  Additionally to the configuration file, we also require some environment variables to be set:
68
68
 
69
- * `GITHUB_TOKEN` with a GitHub token, if the GitHub source is enabled
69
+ - `GITHUB_TOKEN` with a GitHub token, if the GitHub source is enabled
70
70
 
71
71
  While these tokens could potentially also be included the config, we want to make it hard to mistakenly publish secrets within code.
72
72
 
@@ -77,9 +77,9 @@ This section documents all the possible configuration values. For examples see t
77
77
  #### General
78
78
 
79
79
  | Field | Data Type | Required | Default | Description |
80
- |-------------------|-----------|----------|---------|----------------------------------------------------|
80
+ | ----------------- | --------- | -------- | ------- | -------------------------------------------------- |
81
81
  | `outputFile` | string | Yes | - | Path to contributions output file |
82
- | `bugzilla` | Object | No | - | Bugzilla configuration options (see below) |
82
+ | `bugzilla` | Object | No | - | Bugzilla configuration options (see below) |
83
83
  | `communityPortal` | Object | No | - | Community Portal configuration options (see below) |
84
84
  | `discourse` | Object | No | - | Discourse configuration options (see below) |
85
85
  | `github` | Object | No | - | GitHub configuration options (see below) |
@@ -87,20 +87,20 @@ This section documents all the possible configuration values. For examples see t
87
87
 
88
88
  #### Bugzilla
89
89
 
90
- | Field | Data Type | Required | Default | Description |
91
- |-----------------------|-----------|----------|---------------------------|----------------------------------------------------------------------------------------------------------------------------|
92
- | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `mediaWiki` object entirely. |
93
- | `baseUrl` | string | Yes | - | API base url without trailing slash (for example: `https://bugzilla.mozilla.org`) |
94
- | `username` | string | Yes | - | Username on MediaWiki |
95
- | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
96
- | `types` | Object | No | - | Object containing the different labels below |
97
- | `types.createdType` | string | No | Created a Bug Report | Label for entries related to having report a bug/enhancement. |
98
- | `types.commentedType` | string | No | Commented on a Bug Report | Label for entries related to having commented on a bug/enhancement. |
90
+ | Field | Data Type | Required | Default | Description |
91
+ | --------------------- | --------- | -------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
92
+ | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `mediaWiki` object entirely. |
93
+ | `baseUrl` | string | Yes | - | API base url without trailing slash (for example: `https://bugzilla.mozilla.org`) |
94
+ | `username` | string | Yes | - | Username on MediaWiki |
95
+ | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
96
+ | `types` | Object | No | - | Object containing the different labels below |
97
+ | `types.createdType` | string | No | Created a Bug Report | Label for entries related to having report a bug/enhancement. |
98
+ | `types.commentedType` | string | No | Commented on a Bug Report | Label for entries related to having commented on a bug/enhancement. |
99
99
 
100
100
  #### Community Portal
101
101
 
102
102
  | Field | Data Type | Required | Default | Description |
103
- |---------------------|-----------|----------|----------------------------|----------------------------------------------------------------------------------------------------------------------------|
103
+ | ------------------- | --------- | -------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
104
104
  | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `communityPortal` object entirely. |
105
105
  | `baseUrl` | string | Yes | - | Community Portal base url without trailing slash |
106
106
  | `username` | string | Yes | - | Username on the Community Portal |
@@ -109,48 +109,48 @@ This section documents all the possible configuration values. For examples see t
109
109
 
110
110
  #### Discourse
111
111
 
112
- | Field | Data Type | Required | Default | Description |
113
- |---------------------|-----------|----------|---------------------------|----------------------------------------------------------------------------------------------------------------------------|
114
- | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `discourse` object entirely. |
115
- | `baseUrl` | string | Yes | - | API base url without trailing slash |
116
- | `username` | string | Yes | - | Username on Discourse |
117
- | `topicType` | string | No | Created Discourse Topic | Label for entries related to having created a new topic. |
118
- | `postType` | string | No | Posted on Discourse Topic | Label for entries related to having posted on an existing topic. |
112
+ | Field | Data Type | Required | Default | Description |
113
+ | ----------- | --------- | -------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
114
+ | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `discourse` object entirely. |
115
+ | `baseUrl` | string | Yes | - | API base url without trailing slash |
116
+ | `username` | string | Yes | - | Username on Discourse |
117
+ | `topicType` | string | No | Created Discourse Topic | Label for entries related to having created a new topic. |
118
+ | `postType` | string | No | Posted on Discourse Topic | Label for entries related to having posted on an existing topic. |
119
119
 
120
120
  #### GitHub
121
121
 
122
- | Field | Data Type | Required | Default | Description |
123
- |----------------------------|-----------|----------|---------|----------------------------------------------------------------------------------------------------------------------------|
124
- | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `github` object entirely. |
125
- | `allowPrivate` | boolean | No | false | Indicates whether fetching from private repositories is allowed. If not set, the script will throw if you pass a `GITHUB_TOKEN` with private repo scope. In most cases you will not want to have a token with private scope as you do not want to leak any private information in your contribution overview. Please think twice before enabling this config. |
126
- | `commentsEnabled` | boolean | No | true | Indicates whether fetching comments is enabled. |
127
- | `commitsEnabled` | boolean | No | true | Indicates whether fetching commits is enabled. |
128
- | `issuesEnabled` | boolean | No | true | Indicates whether fetching issues is enabled. |
129
- | `reviewsEnabled` | boolean | No | true | Indicates whether fetching reviews is enabled. |
130
- | `username` | string | Yes | - | Username on GitHub |
131
- | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
132
- | `filter` | string | Yes | - | Regex to apply to each entry to filter for organization/repo names. For example: `"mozilla|firefox"` to only include orgs and repos with either "mozilla" or "firefox" it their name.|
133
- | `types` | Object | No | - | Object containing the different labels below |
134
- | `types.commit` | string | No | GitHub Commit | Label for entries related to GitHub commits |
135
- | `types.privateCommit` | string | No | Commit in private repository | Label for entries related to private GitHub commits |
136
- | `types.createdPR` | string | No | Created PR | Label for entries related to opening GitHub PRs |
137
- | `types.createdIssue` | string | No | Created Issue Report | Label for entries related to creating GitHub issues |
138
- | `types.commented` | string | No | Commented on an Issue | Label for entries related to commenting on an issue |
139
- | `types.commentedPR` | string | No | Commented on a Pull Request | Label for entries related to commenting on a GitHub PR (review) |
140
- | `types.approvedPR` | string | No | Approved a Pull Request | Label for entries related to approving a GitHub PR |
141
- | `types.changesRequestedPR` | string | No | Requested changes on a Pull Request | Label for entries related to requesting changes on a GitHub PR |
142
- | `types.reviewedPR` | string | No | Reviewed a Pull Request | Label for entries related to reviewing a GitHub PR (fallback) |
143
- | `delayMsPerRequest` | number | No | 2000 | Delay between each request to GitHub. You might hit rate limiting if you set this lower than default. |
122
+ | Field | Data Type | Required | Default | Description |
123
+ | -------------------------- | --------- | -------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
124
+ | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `github` object entirely. |
125
+ | `allowPrivate` | boolean | No | false | Will throw if you pass a `GITHUB_TOKEN` with possible private repo scope. In most cases you will not want to have a token with private scope. Please think twice before enabling this config. When using fine-grained tokens, you need to set this to `true` manually as we can't detect the scopes. In that case, we can't guarantee anything! |
126
+ | `commentsEnabled` | boolean | No | true | Indicates whether fetching comments is enabled. |
127
+ | `commitsEnabled` | boolean | No | true | Indicates whether fetching commits is enabled. |
128
+ | `issuesEnabled` | boolean | No | true | Indicates whether fetching issues is enabled. |
129
+ | `reviewsEnabled` | boolean | No | true | Indicates whether fetching reviews is enabled. |
130
+ | `username` | string | Yes | - | Username on GitHub |
131
+ | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
132
+ | `filter` | string | Yes | - | Regex to apply to each entry to filter for organization/repo names. For example: `^mozilla` to only include orgs and repos that start with "mozilla". |
133
+ | `types` | Object | No | - | Object containing the different labels below |
134
+ | `types.commit` | string | No | GitHub Commit | Label for entries related to GitHub commits |
135
+ | `types.privateCommit` | string | No | Commit in private repository | Label for entries related to private GitHub commits |
136
+ | `types.createdPR` | string | No | Created PR | Label for entries related to opening GitHub PRs |
137
+ | `types.createdIssue` | string | No | Created Issue Report | Label for entries related to creating GitHub issues |
138
+ | `types.commented` | string | No | Commented on an Issue | Label for entries related to commenting on an issue |
139
+ | `types.commentedPR` | string | No | Commented on a Pull Request | Label for entries related to commenting on a GitHub PR (review) |
140
+ | `types.approvedPR` | string | No | Approved a Pull Request | Label for entries related to approving a GitHub PR |
141
+ | `types.changesRequestedPR` | string | No | Requested changes on a Pull Request | Label for entries related to requesting changes on a GitHub PR |
142
+ | `types.reviewedPR` | string | No | Reviewed a Pull Request | Label for entries related to reviewing a GitHub PR (fallback) |
143
+ | `delayMsPerRequest` | number | No | 2000 | Delay between each request to GitHub. You might hit rate limiting if you set this lower than default. |
144
144
 
145
145
  #### MediaWiki
146
146
 
147
- | Field | Data Type | Required | Default | Description |
148
- |---------------------|-----------|----------|-----------|----------------------------------------------------------------------------------------------------------------------------|
149
- | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `mediaWiki` object entirely. |
150
- | `baseUrl` | string | Yes | - | API base url without trailing slash |
151
- | `username` | string | Yes | - | Username on MediaWiki |
152
- | `editType` | string | No | Wiki Edit | Label for entries related to having edited an article. |
153
- | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
147
+ | Field | Data Type | Required | Default | Description |
148
+ | ---------- | --------- | -------- | --------- | -------------------------------------------------------------------------------------------------------------------- |
149
+ | `enabled` | boolean | Yes | - | Indicates whether this data source is enabled. Alternatively you can also leave off the `mediaWiki` object entirely. |
150
+ | `baseUrl` | string | Yes | - | API base url without trailing slash |
151
+ | `username` | string | Yes | - | Username on MediaWiki |
152
+ | `editType` | string | No | Wiki Edit | Label for entries related to having edited an article. |
153
+ | `stopDate` | string | Yes | - | `new Date()` parseable string containing a date of possibly earliest contribution to track |
154
154
 
155
155
  ### Sample configuration
156
156
 
@@ -198,7 +198,7 @@ const config = {
198
198
  approvedPR: 'Approved a Pull Request',
199
199
  changesRequestedPR: 'Requested changes on a Pull Request',
200
200
  reviewedPR: 'Reviewed a Pull Request',
201
- }
201
+ },
202
202
  },
203
203
  };
204
204
  ```