Git Product home page Git Product logo

archivematica-fpr-admin's People

Contributors

ablwr avatar hwesta avatar jhsimpson avatar jraddaoui avatar jrwdunham avatar mcantelon avatar mistydemeo avatar sevein avatar sromkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archivematica-fpr-admin's Issues

Problem: this project isn't using tox/flake8/etc

It's become a standard in the AM team but this project is not using it yet.
For now, see .travis.yml to know more about how we're running the tes.
There is also a mention in DEVELOPMENT.md.

Problem: disk image formats not getting correct PRONOM ID

The FIDO format id command (defined here: https://github.com/artefactual/archivematica-fpr-admin/blob/stable/1.6.x/fpr/migrations/pronom84_idcommands_all.json#L36 )

references a file that is installed as part of archivematicaCommon:
https://github.com/artefactual/archivematica/blob/stable/1.6.x/src/archivematicaCommon/lib/externals/fido/archivematica_format_extensions.xml

This lists some custom formats. It was added to Archivematica in 2014, because there were disk image formats that, at the time, we not listed in the PRONOM registry.

Now with PRONOM v88, all but one of those custom 'archivematica-x-fmt/*' entries have proper PRONOM IDs.

The Fido command should be updated, so that it no longer references this file. The file can be removed from archivematicaCommon.

The only entry that is still needed is for 'raw disk image' since there is no PRONOM entry for this. it should be possible to just include the following xml snippet in the fido fpr command directly:

<format> <puid>archivematica-fmt/4</puid> <name>Raw disk image</name> <extension>dd</extension> <extension>dd.001</extension> <extension>001</extension> </format>

This problem is blocking JiscSD/archivematica#13

Problem: OCR files can overwrite one another

If a transfer contains two OCR-able files with the same name, then the resulting .txt file transcriptions will both be written to the same filename under metadata/OCRfiles/ and the second will overwrite the first. There will still be two File model instances in the db, however, and the result of this will be that createMETS_v2.0 will fail at MCPClient/clientScripts/archivematicaCreateMETS2.py", line 800, in createFileSec
f = File.objects.get(**kwargs) (where kwargs = {"removedtime__isnull": True, fileGroupType: fileGroupIdentifier, "currentlocation": directoryPathSTR}) because there will be 2 OCR text files with the same currentlocation attribute.

See https://projects.artefactual.com/issues/11651

Problem: slug field in Format and FormatVersion is not ensuring uniqueness

While working on #63 we found that we had two formats and their corresponding formatversions that had the very same description. The latest one added took the same slug causing MultipleObjectsReturned exceptions.

I think that the slug fields for these two models should be updated so they ensure uniqueness. This is something that the old django-slugfield seems to support out of the box. Perhaps we can also move to Django's SlugField?

Problem: migration 0004 breaks upgrade if fprules have been customized

Migration 0004 runs loaddata, using pronom_88.json. That json file has new fprules defined in it, for example:

    {
        "fields": {
            "count_not_okay": 0,
            "replaces": null,
            "count_attempts": 0,
            "uuid": "dfc4197d-d265-4eac-839d-b267d4ac4a9f",
            "format": "dc76c66b-8be8-45f4-a8c8-7d40a47a5b52",
            "lastmodified": "2016-12-14T14:04:19Z",
            "enabled": true,
            "command": "80314f3c-5d48-4ad1-a9f2-2c0f7c7b229d",
            "purpose": "characterization",
            "count_okay": 0
        },
        "model": "fpr.fprule",
        "pk": 712
    },

Each new instance of the fprule model defines a pk to use. If the database already has a row with that pk used, then the loaddata method tries to overwrite it. If that row has a uuid that is referred to in a replaces_id property of some other row in the database, the upgrade fails on an integrityError.

It is not necessary to pre-define the pk values. Omitting them works, the database will assign new keys automatically, and avoid this problem.

It would be better to avoid the use of loaddata altogether, ( see #38 ) but removing the pk's will fix the problem of not being able to upgrade Archivematica from 1.5.1 to 1.6.0 when the fpr has been customized.

Custom templatetag revision_links does not use reverse

We should do something like:

from django.core.urlresolvers import reverse

return '<a class="revisions_link" href="{}">Revision history</a>'.format(reverse('revision_list', kwargs={'entity_name': revision_type, 'uuid': object_uuid}))

instead of:

return '<a class="revisions_link" href="/fpr/revisions/' + revision_type + '/' + object_uuid + '/">Revision History</a>'

Missing pip requirements

Django>=1.8,<1.9
django-annoying==0.7.7
django-autoslug==1.7.1
django-extensions==1.1.1
django-forms-bootstrap>=3.0.0,<4.0.0

Problem: egg doesn't include migrations/*.json

This is causing the following issue:

After running manage.py migrate from the Dashboard on a fresh database:

 Applying fpr.0001_initial... OK
  Applying fpr.0002_initial_data... OK
  Applying fpr.0003_pronom_84.../usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formatgroups_new' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formatgroups_new' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formats_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formats_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formatversions_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_formatversions_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_fptools_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_fptools_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idtools_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idtools_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idcommands_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idcommands_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idrules_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_idrules_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_fprules_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom84_fprules_all' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

 OK
  Applying fpr.0004_pronom_88.../usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom_88' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

WARNING   py.warnings.find_fixtures:  /usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py:235: UserWarning: No fixture named 'pronom_88' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)

 OK
  Applying fpr.0005_update_tool_versions... OK
  Applying fpr.0006_i18n_models... OK

The migration doesn't fail though.

We know using fixtures in our migrations is not good (see #38) but I think that's a different issue.

Problem: FPR error output is unhelpful

Occasionally, while editing a format through the Archivematica FPR UI, an error occurs. The error output looks like this:

(u'U', u'n', u'a', u'b', u'l', u'e', u' ', u't', u'o', u' ', u's', u'a', u'v', u'e', u',', u' ', u'a', u'n', u' ', u'a', u'c', u't', u'i', u'v', u'e', u' ', u'F', u'o', u'r', u'm', u'a', u't', u' ', u'V', u'e', u'r', u's', u'i', u'o', u'n', u' ', u' ', u'w', u'i', u't', u'h', u' ', u't', u'h', u'i', u's', u' ', u'p', u'r', u'o', u'n', u'o', u'm', u' ', u'i', u'd', u' ', u'a', u'l', u'r', u'e', u'a', u'd', u'y', u' ', u'e', u'x', u'i', u's', u't', u's', u'.')

Needless to say, it's not super helpful.

Templates dependency issue

Working on this Django app in isolation showed a couple of situations where we make use of templates that belong to consumers.

  • fpr/templates/app_layout.html extends layout_fluid.html - should the consumer include a local template instead?
  • fpr/templates/format/list.html includes _fpr_update_button.html - should we revisit the update mechanism?

I'm not very experienced developing Django applications but this sounds like a bad practice unless it's documented?

Consumers must embrace Django's collectstatic

Currently, app_layout.html points to static assets of dataTables based on how they're arranged in their consumers. Instead, the consumer should harvest static assets from its Django apps (including this one) during deployment. This can't be fixed in this repo but it's a good to keep the reminder.

This app also assumes that the consumer is providing jQuery. Perhaps we should find better way to match dependencies or create a custom dataTables shim where jQuery is embedded without conflicts with other existing jQuery versions.

  <link href="{% static 'vendor/datatables/css/jquery.dataTables.css %}" rel="stylesheet">
  <script src="{% static 'vendor/datatables/js/jquery.dataTables.min.js' %}"></script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.