1226 Commits

Author SHA1 Message Date
Adrian Moennich
96b4a36480 Citadel: Only warn when deleting non-existent item 2021-05-27 19:29:35 +02:00
Adrian Moennich
a9055b9657 Citadel: Delete records marked as deleted+updated 2021-05-27 18:28:34 +02:00
Adrian Moennich
fd5510eb02 LiveSync: Add missing deleted check when cascading 2021-05-27 18:26:47 +02:00
Adrian Moennich
b4804e08ea Use more modern dict composition syntax 2021-05-27 11:01:52 +02:00
Adrian Moennich
fea862cc3a Citadel: Use better repr in id mapping model 2021-05-27 10:29:58 +02:00
Adrian Moennich
750483bdd2 LiveSync: There are no JS strings 2021-05-26 18:27:23 +02:00
Adrian Moennich
8b99ff0c19 Remove obsolete vidyo transifex config 2021-05-26 18:24:06 +02:00
Indico Team
af13760a01 Update *.pot files 2021-05-26 18:07:38 +02:00
Adrian Moennich
c9700cfc67 Themes/Legacy: Add i18n context 2021-05-26 17:56:56 +02:00
Adrian Moennich
3460094b21 Themes/Legacy: Configure transifex 2021-05-26 17:55:30 +02:00
Adrian Moennich
ea844c8983 Citadel: Configure transifex 2021-05-26 17:40:00 +02:00
Adrian Moennich
77f1ac3c5b Citadel: Add retry option to file upload CLI 2021-05-26 09:26:18 +02:00
Adrian Moennich
3061b2f95d LiveSync: Fix category attachment deletion 2021-05-25 11:19:01 +02:00
Adrian Moennich
920ce3f47c LiveSync: Don't cascade categ prot changes to deleted events 2021-05-24 22:58:54 +02:00
Adrian Moennich
7f4adda35f VC/Zoom: Fix UndefinedError 2021-05-24 18:45:53 +02:00
Adrian Moennich
5a66aa4c29 URSH: Fix more UndefinedErrors 2021-05-24 18:41:28 +02:00
Adrian Moennich
2936e44e6c URSH: Fix trans usage 2021-05-24 17:51:16 +02:00
Adrian Moennich
f0078ee06f Revert "LiveSync: Fix error when changing attachment protection"
This reverts commit eae133e9021252868b105f8124b2a66558442f46.

Made obsolete by indico/indico@7a4248ab8c
2021-05-24 14:27:48 +02:00
Adrian Moennich
eae133e902 LiveSync: Fix error when changing attachment protection 2021-05-24 14:09:02 +02:00
Adrian Moennich
6b409df375 LiveSync: Add missing deleted checks
This resulted in cascades to affect deleted attachments linked to an
event and thus failing runs e.g. after a protection change if it
cascaded to an already-deleted attachment.

Also added a check I forgot in #135
2021-05-24 14:06:38 +02:00
Adrian Moennich
ed3eb176d4 Citadel: Use new search backend active check
And more important, do not access the DB during app initialization
2021-05-24 13:42:46 +02:00
Adrian Moennich
aa0389567b LiveSync: Fix cascading of deletions after cloning
See the docstring on the corresponding test for a detailed description
of the issue this fixes.
2021-05-24 13:30:03 +02:00
Adrian Moennich
3b94438204 LiveSync: Add retry option to initial export 2021-05-21 18:07:00 +02:00
Adrian Moennich
d24f5034f3 Citadel: Tune retry config 2021-05-21 18:06:45 +02:00
Adrian Moennich
ca2e860415 Citadel: Make thread counts configurable 2021-05-20 11:18:35 +02:00
Adrian Moennich
3ef0b988ba Citadel: Disable search while not configured 2021-05-18 20:22:44 +02:00
Adrian Moennich
707d96a9b5 Citadel: Add more detailed tests 2021-05-18 17:41:42 +02:00
Adrian Moennich
f1a0da71e0 Citadel: Fix range aggregations 2021-05-18 17:41:39 +02:00
Pedro Lourenço
967e146344 Citadel: Add test for aggregation flattening 2021-05-18 12:27:19 +01:00
Pedro Lourenço
76d4c0562a Citadel: Flatten the most common aggregations 2021-05-18 12:23:15 +01:00
Pedro Lourenço
a1dc1f94c9 Citadel: Rename best match sorting to most relevant 2021-05-18 12:23:11 +01:00
Adrian Moennich
40b1a0b60a Citadel: Move get_user_access to plugin 2021-05-18 12:39:56 +02:00
Adrian Moennich
8a790bb42d Citadel: Add option to disable search provider 2021-05-18 12:34:35 +02:00
Adrian Moennich
867e15b57c Storage/S3: Fix bucket API 2021-05-18 12:25:33 +02:00
Adrian Moennich
98067e6b9f Piwik: Fix UndefinedError 2021-05-17 21:55:35 +02:00
Adrian Moennich
57ed55b731 Citadel: Do not send 'notes/minutes' in note title 2021-05-17 11:20:02 +02:00
Adrian Moennich
069b26949c Storage/S3: Fix dynamic bucket hashing
Also run the s3 plugin tests in CI...
2021-05-14 12:39:46 +02:00
Adrian Moennich
d768f71767 Citadel: Update schemas
Co-authored-by: Pedro Lourenço <pedro.lourenco@cern.ch>
2021-05-12 19:13:44 +02:00
Adrian Moennich
145b3f15c5 Citadel: Allow filtering by event id 2021-05-12 18:27:12 +02:00
Adrian Moennich
514dc6bc50 VC/Zoom: Fix ESLint errors 2021-05-12 11:48:30 +02:00
Adrian Moennich
d51564b2ad npm audit fix 2021-05-12 11:31:24 +02:00
dependabot[bot]
602ae41155 Bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 18:13:47 +02:00
Adrian
f52ee3184a
Themes/Legacy: Add plugin with 'nicecompact' theme (#127)
* Add plugin (data copied from core)
* Only apply styles to event area
2021-05-11 15:53:18 +00:00
Adrian Moennich
805f653e97 Citadel: Compress very large access lists
People who are in hundreds of groups otherwise can't search for anything
because the request gets too large. Ideally Citadel accepted POST
requests, but those are already used for data modifications, so we are
stuck with GET for now.
2021-05-10 12:20:12 +02:00
Adrian Moennich
8d655a8dce Storage/S3: Move content disposition util to plugin
It was in the indico core because flask did not expose it and we needed
it there, but that's no longer the case (still not exposed though) so we
include it here now.
2021-05-10 12:20:12 +02:00
dependabot[bot]
4afb7bbac3 Bump lodash from 4.17.20 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 16:54:01 +02:00
Adrian
ec3d167175
Add new search infrastructure (#125)
* Enable CI on search branch

* LiveSync: Clean titles in verbose iterator

* LiveSync: Refactor initial export batching

And make the batch size configurable via commandline option

* LiveSync/Citadel: Support Citadel as the sync backend

Co-authored-by: penelope <penelope@fnal.gov>

* LiveSync/Citadel: Upgrade to python3

* LiveSync/Citadel: Update backend and refactor schemas

* LiveSync/Citadel: Add placeholders and filters/aggregations

* LiveSync/Citadel: Add range filters

* LiveSync/Citadel: Update the schemas and initial indexing

* LiveSync/Citadel: Refactor tests

* LiveSync/Citadel: Add status force list to upload retries

* LiveSync/Citadel: Update clean_old_entries filter

* LiveSync/Citadel: Update file headers

* LiveSync/Citadel: Add allowed methods in citadel retry

Commit more often in batches

* Citadel: Rename livesync_citadel to citadel

It's no longer just livesync

* Citadel: Move metadata to setup.cfg

* Citadel: Remove tika import

* Citadel: Mock things using the pytest way

* Citadel: Run pyupgrade

* Citadel: Run tests in CI

* Citadel: Use 'search' plugin category

* Citadel: Improve settings form

* Citadel: Fix model and alembic revision

* Citadel: Make livesync backend unique

* Citadel: Fix is_group error

* Citadel: Include schema attribute in the record context

* Citadel: Exclude content from Attachment schema

* Citadel: Use cached category path from context

* Citadel: Fix passing category tree cache to schemas

* Citadel: Remove unused imports

* Citadel: Be more strict with category cache

If the cache exists, we can expect ALL categories to be in there

* Citadel: Fix duplicate _get_identifiers call

* Citadel: Simplify record uploading

* ci: Allow `search` as valid upstream branch

* Add support for attachment file uploading

* Update file id mapping

* Update cli to a unique backend

* Merge file column migration with previous revision

* Refactor citadel and remove obsolete parts

* Citadel: Cache search_owner_role setting

* Citadel: Dump before parallelization

* Citadel: Do not retry on 500, use lower delays

* Remove change_type from upload_record

* Define a maximum number of pages

ES limits results up to 10,000 hits

* Add missing linebreak

* Citadel: Include category_id in search data

* Convert the aggregations to an object

* Raise request exceptions

* Move query formatting methods to util

* Remove search owner role setting

* Move the object type to filters

* Fix optional string based matches

Update tests

* Citadel: Include start/end dt for subcontribs

* Citadel: Add tests for schemas

* LiveSync: Pass force flag to backends

* Citadel: Skip already-exported entries unless forced

Like this resuming a failed initial export is as easy as just
running the command again.

* LiveSync: eager-load subcontrib timetable entry

* Citadel: Remove obsolete context

* Citadel: Do not upload empty files

* LiveSync: Fix changing root category protection mode

* Citadel: Fix access logic for empty ACLs

Also add unit tests for this

* Citadel: Add contrib/subcontrib duration to schemas

* LiveSync: Add verbose mode

* Remove record dumping if it's being deleted

* Simplify run_initial_export

* Citadel: Print change type in verbose mode

* Citadel: Ignore create-and-delete changes

* LiveSync: Fix tests

* LiveSync: Move citadel-specific code to citadel plugin

* Citadel: Make id mapping entries unique

* Citadel: Refactor http logic

* Citadel: Use 1:1 relationship for id mapping

* Citadel: Use more sensible argument order in id mapping

* LiveSync: Correctly handle (sub) contribution changes

- track contribution time changes
- cascade contribution changes to subcontributions

* Simplify livesync uploader entries

* LiveSync: Improve naming

* LiveSync: Fix attachment handling

Also fix cascading of contribution changes during simplification step

* Citadel: Fix enum display in error message

* LiveSync: Cascade creation to children

This is necessary e.g. when cloning events because in that case we only
have the event creation record but nothing for the elements inside that
event.

To avoid sending the same thing twice (e.g. a contribution) chunking now
only happens on the simplified change level, not on the record level, to
ensure all recorded changes are taken into account when simplifying them
to creation/updates/deletions.

* LiveSync: Allow deferring initial export done flag

In case of Citadel we want to require a file export as well before
starting to process the queue to avoid cases where we are still doing
an initial file upload but queue runs start happening and we would
end up sending old files as well.

* Citadel: Upload files after a queue run

* Refactor checks whether queue runs are possible

Also add an `indico citadel reset` command to throw away all local
citadel data

* Citadel: Re-upload attachments whose file changed

* LiveSync: Fix title in initial export progress

* Citadel: Make max file size configurable

* Check if a livesync plugins is properly configured

And use it to check whether citadel has url and token set

* LiveSync/Debug: Fix errors and use schemas

* Citadel: Refactor verbose printing

* LiveSync: Remove unnecessary default value

* Update the search API to support multiple types

* Move reset cli from citadel to livesync core

* Citadel: Rename model/table

* Citadel: Remove unnecessary timestamp column

* Citadel: Remove some overly verbose comments

* Citadel: Commit explicitly outside create()

* Citadel: Do not send None inside _data

* LiveSync: Fix handling notes

* Citadel: Integrate placeholders with Indico (#117)

* LiveSync: Fix query spam in user.is_system check

* Citadel: Use new result schemas

* Update search schemas

* Citadel: Various improvements/fixes

* Citadel: Integrate filters with Indico & update placeholders (#119)

* Move dump schemas from core to livesync

* Use type_format only in citadel code

* Citadel: Strip HTML from descriptions/notes

* Citadel: Show message if some fails failed to upload

* Add category id filter

* Citadel: Add some debug logging during file uploads

* Citadel: Allow filtering by category name

* Update title and type placeholders

* Citadel: Add -f as --force shortcut

* Fix quote dividers in a multi placeholder query

* Use all worker threads all the time

* Close responses from uploads

Hopefully this fixes running out of fds after ~240k uploads

* Add some more debug logging

* Fix incorrect output

* Rename type placeholder

* Supported quotes for exact matches

* LiveSync: Fix cascading issues

- do not cascade implicit changes to deleted attachments
- correctly cascade changes involving session-linked objects

* Improve error handling

* Citadel: Do not enable queue runs after max-size usage

* LiveSync: Add setting to disable queue runs

* LiveSync: Check category blacklist in initial export

* LiveSync: Add schema tests

* LiveSync: Handle and cascade location changes

* Move query formatting outside the f-string

* Refactor the search query parser

Ensures the keyword positioning isn't changed and correctly
sanitizes placeholder content.

* Escape whitelisted placeholders

Co-authored-by: Adrian <adrian@planetcoding.net>

* Strip the result query

* Remove placeholder operator

* Add default operator

* Update tests

* Add support for sort options (#123)

* Add support for sort options
* Rename SearchFilter to SearchOption
* Rename sort option keys

* Fix error with lazy strings in filter labels

* Revert "Enable CI on search branch"

This reverts commit 2ec3f650eed02cd6c72ea336fa92df6927b8da39.

Co-authored-by: Pedro Lourenço <pedro.lourenco@cern.ch>
Co-authored-by: Michal Kolodziejski <michal.kolodziejski@cern.ch>
Co-authored-by: Penelope Constanta <penelope@fnal.gov>
2021-05-07 14:47:59 +00:00
Adrian Moennich
e5a3842bf3 LiveSync/Debug: Remove MARCXML code 2021-04-19 18:26:30 +02:00
Adrian Moennich
7479c36b01 LiveSync: Remove legacy MARCXML code 2021-04-19 18:26:09 +02:00
Adrian Moennich
84381e8eea Run latest pyupgrade 2021-04-14 12:36:41 +02:00