Skip to content
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

Upgrade inventory-app extension to support CKAN2.9 and Python3 #3388

Closed
17 of 19 tasks
jbrown-xentity opened this issue Aug 20, 2021 · 2 comments
Closed
17 of 19 tasks

Upgrade inventory-app extension to support CKAN2.9 and Python3 #3388

jbrown-xentity opened this issue Aug 20, 2021 · 2 comments

Comments

@jbrown-xentity
Copy link
Contributor

jbrown-xentity commented Aug 20, 2021

User Story

As a data.gov developer, I want ckanext-datagov_inventory running with CKAN 2.9 and Python 3 so that we can move out of CKAN 2.8 and reduce our technical debt and meet compliance standards.

Acceptance Criteria

  • WHEN I view CI
    THEN I see a successful job testing the extension under CKAN 2.9
    AND I see a successful job testing the extension under CKAN 2.8
    AND I see a successful job testing the extension under the legacy test environment
  • WHEN I remove the tests
    THEN I see CI fail due to test coverage being below a threshold

Background

CKAN 2.9 extension tracker.

Details / tasks

The goal is to support running this extension against CKAN 2.9 (Python 3) and CKAN 2.8 (Python 2) environments.
Please refer to the main CKAN documentation for Python 3 extensions migration. We're not following this guide exactly. Instead of creating a long-lived py3 branch, we should be merging often. New CI test suites don't need to required or to be fully passing in order to merge. It's only important that changes don't introduce new failures or break the existing test suites.

Below are a list of tasks. Depending on the extension's functionality, not all tasks will be actionable.

Tasks:

  • Update spreadsheet to indicate the extension upgrade is in progress
  • Rename default branch -> main.
  • Remove any CKAN 2.3 tests and functionality
  • Dependencies must be python 3 compatible (run caniusepython3 -r requirements.txt from within the virtualenv) and post the results to this issue (docs)
  • Add additional CI config for CKAN 2.8 and 2.9 Update CI config. These new CI jobs do not to be required yet (docs)
    • add code coverage reporting and required threshold (example)
  • Update documentation with compatibility table (docs)
    • Features
    • "Usage" (how to use/install/configure the extension) vs "Development" (how to test etc)
    • Required extensions and dependencies
    • "Weak" dependencies or how this code interacts with other extensions
  • Update/add docker-compose environment in order to run tests locally (example)
  • Update test suite (docs)
    • consider copying tests dir to tests/nose in order to preserve existing test environment (example)
    • replace nose with pytest (example)
  • Fix Python 3 issues / futurize code (docs)
    • Install future and run futurize --both-stages --write ckanext
  • Import from core ckan using toolkit (git grep -w 'paste\|pylons' should return no imports) (docs)
  • (optional) Create Mixin plugin implementations for Pylons / Flask (docs) (example)
  • Convert controllers to flask views/blueprints (docs)
  • Migrate Paster CLI commands to Click (docs)
  • Migrate js and css assets to Web assets (docs) (example)
  • Update templates (docs) (example)
    • you may want to split the template for CKAN >=2.9 in order to keep templates readable while maintaining backwards compatibility
    • update resource tags to asset for Web Assets
    • update controller='package' -> controller='dataset' or controller='resource'
  • Update spreadsheet to indicate the extension upgrade is complete
  • Re-enable commented-out tests in the inventory-app deployment

Additional resources:

@nickumia-reisys nickumia-reisys self-assigned this Aug 24, 2021
@nickumia-reisys
Copy link
Contributor

This is strange given that this is branched off of the working py3_build...

~/inventory-app$ caniusepython3 -r requirements.txt
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-datajson.git@a842fa67ff8e3e9e85e80ebc3b34d3c17a38dd2f': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-googleanalyticsbasic@10ebfe25744b0f6e4cb1294f4a16654eb13119f6': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-usmetadata.git@f28f00bf255a16d59117f443949a290108344a89': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/ckan/ckanext-xloader.git@c770ef16b3673c12965af2465cb23991a01850ac': could not parse requirement
[WARNING] Skipping ckan: URL-specified projects unsupported
[WARNING] Skipping ckanext-s3filestore: URL-specified projects unsupported
[WARNING] Skipping ckanext-saml2auth: URL-specified projects unsupported
Finding and checking dependencies ...
[ERROR] Failed to get external data for https://www.red-dove.com/pypi/projects/C/ckanext-dcat-usmetadata/project.json: HTTP Error 404: Not Found
Traceback (most recent call last):
  File "/home/nickumia/.local/lib/python3.8/site-packages/distlib/util.py", line 915, in _get_external_data
    resp = urlopen(url)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
[WARNING] ckanext-dcat-usmetadata not found; false-negatives possible

You need 14 projects to transition to Python 3.
Of those 14 projects, 14 have no direct dependencies blocking their transition:

  ckanext-envvars
  ckantoolkit
  click
  flask
  itsdangerous
  jinja2
  json-table-schema
  lepl
  markupsafe
  messytables
  passlib
  pathtools
  shutilwhich
  werkzeug
~/inventory-app$ caniusepython3 -r requirements.in.txt
[WARNING] Skipping 'git+https://github.com/ckan/ckan.git@ckan-2.9.3': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-googleanalyticsbasic': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-usmetadata.git@main': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/GSA/ckanext-datajson.git@main': could not parse requirement
[WARNING] Skipping 'git+https://github.com/keitaroinc/ckanext-saml2auth.git@main': could not parse requirement
[WARNING] Skipping 'git+https://github.com/keitaroinc/ckanext-s3filestore.git': could not parse requirement
[WARNING] Skipping '-e git+https://github.com/ckan/ckanext-xloader.git@master': could not parse requirement
[WARNING] Skipping '-r ${SRC_DIR}/ckan/requirements.txt': could not parse requirement
Finding and checking dependencies ...
[ERROR] Failed to get external data for https://www.red-dove.com/pypi/projects/C/ckanext-dcat-usmetadata/project.json: HTTP Error 404: Not Found
Traceback (most recent call last):
  File "/home/nickumia/.local/lib/python3.8/site-packages/distlib/util.py", line 915, in _get_external_data
    resp = urlopen(url)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
[WARNING] ckanext-dcat-usmetadata not found; false-negatives possible

You need 5 projects to transition to Python 3.
Of those 5 projects, 4 have no direct dependencies blocking their transition:

  ckanext-envvars
  ckantoolkit
  lepl
  json-table-schema (which is blocking messytables)

@nickumia-reisys
Copy link
Contributor

Important CKAN change: ckan/ckan#3972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants