Skip to content

Commit

Permalink
[IMP] formio: formio.js GitHub Downloader fetch 100 tags (previously …
Browse files Browse the repository at this point in the history
…30).

Fetch 100 tags by adding (URL query) parameter `per_page=100`.
Previously, 30 tags were fetched (default `per_page=30`).
  • Loading branch information
bobslee committed Nov 25, 2021
1 parent 5970d92 commit d0d991d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions formio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 9.3

- Improve the formio.js library Downloader and Installer tool.\
Fetch 100 tags by adding (URL query) parameter `per_page=100`.\
Previously, 30 tags were fetched (default `per_page=30`).

### 9.2

- Fix Form submit: Error `_logger is undefined` in method `mail_activity_partner_linking`.\
Expand Down
2 changes: 1 addition & 1 deletion formio/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
'name': 'Forms',
'summary': 'Form Builder & integration of professional and versatile Forms to collect any information you need for your business.',
'version': '9.2',
'version': '9.3',
'license': 'LGPL-3',
'author': 'Nova Code',
'website': 'https://www.novacode.nl',
Expand Down
4 changes: 3 additions & 1 deletion formio/models/formio_version_github_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class VersionGitHubTag(models.Model):
# formio.js published release ain't available with the GitHub releases API
# https://developer.github.com/v3/repos/releases/#list-releases
#
# GitHub tags API
# GitHub tags API:
# https://developer.github.com/v3/repos/#list-repository-tags
# - Results per page (max 100)
# - Sorted by tag name (descending)

name = fields.Char(required=True)
version_name = fields.Char('_compute_fields')
Expand Down
12 changes: 11 additions & 1 deletion formio/wizard/formio_version_github_checker_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ def check_new_versions(self):
token = self.env['ir.config_parameter'].sudo().get_param('formio.github.personal.access.token')
if token:
headers = {"Authorization": token}
response = requests.get('https://api.github.com/repos/formio/formio.js/tags', headers=headers)

# IMPORTANT NOTES
# ===============
# formio.js published release ain't available with the GitHub releases API
# https://developer.github.com/v3/repos/releases/#list-releases
#
# GitHub tags API:
# https://developer.github.com/v3/repos/#list-repository-tags
# - Results per page (max 100)
# - Sorted by tag name (descending)
response = requests.get('https://api.github.com/repos/formio/formio.js/tags?per_page=100', headers=headers)

if response.status_code == 200:
tags = response.json()
Expand Down

0 comments on commit d0d991d

Please sign in to comment.