Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into beta
* master:
  Handle selenium http-proxy errors without dying
  Bump http-proxy to 1.18.0
  MBS-10370: Add "direction: forward" to XML WS rels (#1212)
  MBS-10355: Display track artist on recording pages (#1207)
  MBS-4980: Use catnos to sort releases in RG page (#1185)
  MBS-5479: Add an "Edit Relationships" tab (#1219)
  MBS-4913: Indicate the number of CAA pieces on tab (#1175)
  MBS-10263: Don't insert annotation if edit is open
  Remove unused add_event_annotation.tt
  MBS-4486: Remove parentheses around disambiguation (#1170)
  MBS-8566: Reuse release AC when importing CD stubs (#1193)
  Fix relationship edit credit display (#1225)
  Add ReleaseEventsDiff to root/server/components.js
  MBS-9920: Convert the recording fingerprints page to React (#1220)
  MBS-10363: Go back to referer on merge cancel (#1210)
  Make no filter result messages more consistent
  Move Filter::Recording to Filter::Generic
  MBS-9915: Convert the artist public pages to React
  MBS-8967: Events aren't dupes if all have comment (#1139)
  MBS-10369: Count descendant countries in stats (#1213)
  MBS-10411: Force coordinates as floats in JSON WS (#1223)
  MBS-10229: Block more shortened/smart URLs (#1106)
  Bump React to 16.10.2 (#1221)
  MBS-10240: Allow seeding "release has no barcode" (#1182)
  Bump Flow to 0.109.0
  MBS-10349: New, more clear headers for rel stats (#1203)
  MBS-10345: Redirect away from /merge if not ready to merge (#1198)
  MBS-10373: Link to How to Write Edit Notes above the edit note fields
  MBS-9111: Stricter validation for empty edit notes
  Remove no longer needed .actions-header
  MBS-10347: Make action columns take only needed space
  Eslint: brace-style
  Eslint: padded-blocks
  Eslint: newline-per-chained-call
  Eslint: indent
  Eslint: object-curly-spacing
  Eslint: quotes
  Eslint: quote-props
  Eslint: no-var
  Eslint: disable sort-keys for cardinalityMap
  MBS-9924: Convert work index to React
  Move CleanupBanner to its own component
  Add limit/offset to /ws/2/discid
  Remove gid sorting from WS lists
  Remove relationship sorting from JSON WS
  Cmp refaddrs in Entity::ArtistCredit::is_equal
  Load release, track, and recording ACs together
  Limit WS release lists to 500 tracks
  Limit # of cache entries per call
  Batch advisory lock calls together
  Fix pathological release loading in /ws/2/discid
  Quicker has_rels
  Use preset Moose attributes for source/target
  Use XML::LibXML for XML WS responses
  Speedup slow meta access in store
  Remove slow target_key function
  Replace slow find_attribute_by_name call with can
  Add View::WS
  Sort relationships in SQL instead of Perl
  Fix file system permissions in CircleCI config
  Compare Entity::ArtistCredit missing artist_id (#1178)
  Convert relationship edit diffs to React
  Allow entity placeholders in link phrase
  Initial port of edit Diff plugin to JavaScript
  Reorder buttons on ConfirmLayout
  Add Flow types to common/utility/clean.js
  Remove unused label arg
  Allow signaling a nameVariation in EntityLink
  Remove display_html_diff
  Don't output class="" in edit diffs
  Convert reactTextContent to ES6 module, add types
  Fix up reactTextContent
  MBS-10353: Tests for release browse ratings
  MBS-10353: Enable ratings for release browse
  Bump Flow to 0.107.0
  MBS-10346: Remove unneeded <p> inside <td>
  React autocomplete component
  Update lodash libdefs
  MBS-3112: Switch order of release editor buttons
  • Loading branch information
mwiencek committed Oct 8, 2019
2 parents 8da29e2 + 530626f commit b8c5a33
Show file tree
Hide file tree
Showing 185 changed files with 5,846 additions and 2,720 deletions.
22 changes: 16 additions & 6 deletions .circleci/config.yml
Expand Up @@ -18,6 +18,8 @@ jobs:
- attach_workspace:
at: &home /home/musicbrainz
- run: |
chown -R musicbrainz:musicbrainz .
chown -R postgres:postgres /home/musicbrainz/pgdata
rm /etc/service/chrome/down && sv start chrome
export JUNIT_OUTPUT_FILE=junit_output/js.xml
sudo -E -H -u musicbrainz carton exec -- prove \
Expand All @@ -35,6 +37,8 @@ jobs:
- attach_workspace:
at: *home
- run: |
chown -R musicbrainz:musicbrainz .
chown -R postgres:postgres /home/musicbrainz/pgdata
# As noted in docker/musicbrainz-tests/DBDefs.pm, CircleCI
# sets NO_PROXY=127.0.0.1,localhost in every container, so
# the Selenium proxy doesn't work unless we make requests
Expand Down Expand Up @@ -77,6 +81,8 @@ jobs:
- attach_workspace:
at: *home
- run: |
chown -R musicbrainz:musicbrainz .
chown -R postgres:postgres /home/musicbrainz/pgdata
echo '127.0.0.1 mbtest' >> /etc/hosts
./docker/musicbrainz-tests/install_pg_extensions.sh
rm /etc/service/{postgresql,redis,template-renderer,website}/down && sv start postgresql redis template-renderer website
Expand Down Expand Up @@ -108,9 +114,9 @@ jobs:
- v1-source-
- checkout
- run: |
git submodule sync
git submodule update --init
chown -R musicbrainz:musicbrainz .
sudo -E -H -u musicbrainz git submodule sync
sudo -E -H -u musicbrainz git submodule update --init
# The checkout step configures git to skip gc, so we run it
# here to reduce .git's size before saving it to cache.
sudo -E -H -u musicbrainz git gc
Expand All @@ -128,13 +134,14 @@ jobs:
- run: |
cd /home/musicbrainz
if [[ ! -d mmd-schema ]]; then
git clone https://github.com/metabrainz/mmd-schema.git
sudo -E -H -u musicbrainz git clone https://github.com/metabrainz/mmd-schema.git
cd mmd-schema
else
chown -R musicbrainz:musicbrainz mmd-schema
cd mmd-schema
git fetch origin
sudo -E -H -u musicbrainz git fetch origin
fi
git checkout $MMD_SCHEMA_TAG
sudo -E -H -u musicbrainz git checkout $MMD_SCHEMA_TAG
cd ../musicbrainz-server
- save_cache:
key: v1-mmd-schema-{{ .Environment.MMD_SCHEMA_TAG }}
Expand All @@ -145,7 +152,9 @@ jobs:
keys:
- v2-node-{{ checksum "yarn.lock" }}
- v2-node-
- run: sudo -E -H -u musicbrainz yarn
- run: |
chown -R musicbrainz:musicbrainz .
sudo -E -H -u musicbrainz yarn
- save_cache:
key: v2-node-{{ checksum "yarn.lock" }}
paths:
Expand All @@ -156,6 +165,7 @@ jobs:
- v3-carton-{{ checksum "cpanfile.snapshot" }}
- v3-carton-
- run: |
chown -R musicbrainz:musicbrainz /home/musicbrainz/{carton-local,vendor}
sudo -E -H -u musicbrainz carton install --cached --deployment
sudo -E -H -u musicbrainz carton bundle
- save_cache:
Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Expand Up @@ -170,6 +170,7 @@ Below outlines how to setup MusicBrainz server with local::lib.
libicu-dev \
liblocal-lib-perl \
libpq-dev \
libxml2 \
libxml2-dev \
cpanminus

Expand Down
1 change: 1 addition & 0 deletions cpanfile
Expand Up @@ -98,6 +98,7 @@ requires 'Text::WikiFormat' => '0.81';
requires 'Throwable' => '0.200009';
requires 'Unicode::ICU::Collator' => '0.002';
requires 'URI' => '1.69';
requires 'XML::LibXML' => '1.70';
requires 'XML::Parser::Lite' => '0.719';
requires 'XML::RSS::Parser::Lite' => '0.10';
requires 'XML::Simple' => '2.20';
Expand Down
2 changes: 0 additions & 2 deletions docker/templates/Dockerfile.sitemaps.m4
@@ -1,7 +1,5 @@
m4_include(`server_base.m4')m4_dnl

RUN apt_install(`libxml2')

copy_common_mbs_files

COPY docker/musicbrainz-sitemaps/consul-template-sitemaps.conf /etc/
Expand Down
1 change: 1 addition & 0 deletions docker/templates/macros.m4
Expand Up @@ -67,6 +67,7 @@ libexpat1 m4_dnl
libicu55 m4_dnl
libpq5 m4_dnl
libssl1.0.0 m4_dnl
libxml2 m4_dnl
perl m4_dnl
postgresql-client-9.5 m4_dnl
postgresql-server-dev-9.5')
Expand Down
3 changes: 2 additions & 1 deletion entities.json
Expand Up @@ -509,7 +509,8 @@
"id": 23
},
"collections": true,
"custom_tabs": ["discids", "cover-art"],
"cover_art": true,
"custom_tabs": ["discids"],
"disambiguation": true,
"edit_table": true,
"last_updated_column": true,
Expand Down
36 changes: 18 additions & 18 deletions flow-typed/npm/lodash_v4.x.x.js
@@ -1,5 +1,5 @@
// flow-typed signature: a9b75804169260d49cda34b56dcfabe1
// flow-typed version: e9dac1347c/lodash_v4.x.x/flow_>=v0.63.x
// flow-typed signature: 978ec408ef4dc26808325571d235d3ca
// flow-typed version: 9f33da9d84/lodash_v4.x.x/flow_>=v0.63.x

declare module "lodash" {
declare type Path = $ReadOnlyArray<string | number> | string | number;
Expand Down Expand Up @@ -265,7 +265,7 @@ declare module "lodash" {
): -1;
// alias of _.head
first<T>(array: ?$ReadOnlyArray<T>): T;
flatten<T, X>(array?: ?Array<Array<T> | X>): Array<T | X>;
flatten<T, X>(array?: ?$ReadOnlyArray<$ReadOnlyArray<T> | X>): Array<T | X>;
flattenDeep<T>(array?: ?(any[])): Array<T>;
flattenDepth(array?: ?(any[]), depth?: ?number): any[];
fromPairs<A, B>(pairs?: ?Array<[A, B]>): { [key: A]: B };
Expand Down Expand Up @@ -391,8 +391,8 @@ declare module "lodash" {
iteratee?: ?ValueOnlyIteratee<T>
): Array<T>;
tail<T>(array?: ?Array<T>): Array<T>;
take<T>(array?: ?Array<T>, n?: ?number): Array<T>;
takeRight<T>(array?: ?Array<T>, n?: ?number): Array<T>;
take<T>(array?: ?$ReadOnlyArray<T>, n?: ?number): Array<T>;
takeRight<T>(array?: ?$ReadOnlyArray<T>, n?: ?number): Array<T>;
takeRightWhile<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
takeWhile<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
union<T>(...arrays?: Array<$ReadOnlyArray<T>>): Array<T>;
Expand Down Expand Up @@ -486,15 +486,15 @@ declare module "lodash" {
a4: Array<T>,
comparator?: Comparator<T>
): Array<T>;
zip<A, B>(a1?: ?(A[]), a2?: ?(B[])): Array<[A, B]>;
zip<A, B, C>(a1: A[], a2: B[], a3: C[]): Array<[A, B, C]>;
zip<A, B, C, D>(a1: A[], a2: B[], a3: C[], a4: D[]): Array<[A, B, C, D]>;
zip<A, B>(a1?: ?($ReadOnlyArray<A>), a2?: ?($ReadOnlyArray<B>)): Array<[A, B]>;
zip<A, B, C>(a1: $ReadOnlyArray<A>, a2: $ReadOnlyArray<B>, a3: $ReadOnlyArray<C>): Array<[A, B, C]>;
zip<A, B, C, D>(a1: $ReadOnlyArray<A>, a2: $ReadOnlyArray<B>, a3: $ReadOnlyArray<C>, a4: $ReadOnlyArray<D>): Array<[A, B, C, D]>;
zip<A, B, C, D, E>(
a1: A[],
a2: B[],
a3: C[],
a4: D[],
a5: E[]
a1: $ReadOnlyArray<A>,
a2: $ReadOnlyArray<B>,
a3: $ReadOnlyArray<C>,
a4: $ReadOnlyArray<D>,
a5: $ReadOnlyArray<E>
): Array<[A, B, C, D, E]>;

zipObject<K, V>(props: Array<K>, values?: ?Array<V>): { [key: K]: V };
Expand Down Expand Up @@ -675,7 +675,7 @@ declare module "lodash" {
iteratees?: ?$ReadOnlyArray<Iteratee<T>> | ?string,
orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string
): Array<T>;
orderBy<V, T: Object>(
orderBy<V, T: {}>(
object: T,
iteratees?: $ReadOnlyArray<OIteratee<*>> | string,
orders?: $ReadOnlyArray<"asc" | "desc"> | string
Expand Down Expand Up @@ -1890,10 +1890,10 @@ declare module "lodash/fp" {
sortedUniq<T>(array: Array<T>): Array<T>;
sortedUniqBy<T>(iteratee: ValueOnlyIteratee<T>, array: Array<T>): Array<T>;
tail<T>(array: Array<T>): Array<T>;
take<T>(n: number): (array: Array<T>) => Array<T>;
take<T>(n: number, array: Array<T>): Array<T>;
takeRight<T>(n: number): (array: Array<T>) => Array<T>;
takeRight<T>(n: number, array: Array<T>): Array<T>;
take<T>(n: number): (array: $ReadOnlyArray<T>) => Array<T>;
take<T>(n: number, array: $ReadOnlyArray<T>): Array<T>;
takeRight<T>(n: number): (array: $ReadOnlyArray<T>) => Array<T>;
takeRight<T>(n: number, array: $ReadOnlyArray<T>): Array<T>;
takeLast<T>(n: number): (array: Array<T>) => Array<T>;
takeLast<T>(n: number, array: Array<T>): Array<T>;
takeRightWhile<T>(predicate: Predicate<T>): (array: Array<T>) => Array<T>;
Expand Down
5 changes: 5 additions & 0 deletions lib/DBDefs/Default.pm
Expand Up @@ -440,6 +440,11 @@ sub USE_SELENIUM_HEADER { 0 }

sub WIKIMEDIA_COMMONS_IMAGES_ENABLED { 1 }

# On release browse endpoints in the webservice, we limit the number of
# releases returned such that the total number of tracks doesn't exceed this
# number.
sub WS_TRACK_LIMIT { 500 }

################################################################################
# Profiling
################################################################################
Expand Down
26 changes: 14 additions & 12 deletions lib/MusicBrainz/Script/JSONDump/Constants.pm
Expand Up @@ -12,41 +12,43 @@ our @EXPORT_OK = qw(
%DUMPED_ENTITY_TYPES
);

my @inc_rels = map { ($_ =~ s/_/-/gr) . '-rels' } @RELATABLE_ENTITIES;
my %inc_rels = (
relations => [map { ($_ =~ s/_/-/gr) . '-rels' } @RELATABLE_ENTITIES],
);

Readonly our %DUMPED_ENTITY_TYPES => (
area => {
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres )], %inc_rels),
},
artist => {
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres )], %inc_rels),
},
event => {
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres )], %inc_rels),
},
instrument => {
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres )], %inc_rels),
},
label => {
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres )], %inc_rels),
},
place => {
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres )], %inc_rels),
},
recording => {
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits isrcs ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits isrcs ratings tags genres )], %inc_rels),
},
release => {
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits discids isrcs labels media recording-level-rels recordings release-groups tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits discids isrcs labels media recording-level-rels recordings release-groups tags genres )], %inc_rels),
},
release_group => {
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation artists artist-credits ratings tags genres )], %inc_rels),
},
series => {
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation tags genres )], %inc_rels),
},
work => {
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres ), @inc_rels]),
inc => WebServiceInc->new(inc => [qw( aliases annotation ratings tags genres )], %inc_rels),
},
);

Expand Down
3 changes: 2 additions & 1 deletion lib/MusicBrainz/Server.pm
Expand Up @@ -448,7 +448,7 @@ around 'finalize_error' => sub {
$c->res->{status} = $c->stash->{status};
} else {
$c->res->{body} = 'clear';
$c->view('Default')->process($c);
$c->view->process($c);
$c->res->{body} = encode('utf-8', $c->res->{body});
$c->res->{status} = 503
if $timed_out;
Expand Down Expand Up @@ -505,6 +505,7 @@ sub TO_JSON {
number_of_revisions
own_collections
release_artwork
release_artwork_count
server_details
server_languages
subscribed
Expand Down
16 changes: 10 additions & 6 deletions lib/MusicBrainz/Server/Controller/Ajax.pm
@@ -1,6 +1,7 @@
package MusicBrainz::Server::Controller::Ajax;
BEGIN { use Moose; extends 'Catalyst::Controller' };

use JSON qw( encode_json );
use MusicBrainz::Server::FilterUtils qw(
create_artist_release_groups_form
create_artist_releases_form
Expand All @@ -11,27 +12,30 @@ sub filter_artist_release_groups_form : Local {
my ($self, $c) = @_;

my $artist_id = $c->req->query_params->{artist_id};
create_artist_release_groups_form($c, $artist_id);
my $form = create_artist_release_groups_form($c, $artist_id);

$c->stash(template => 'components/filter-form.tt');
$c->res->body(encode_json($form->TO_JSON));
$c->res->content_type('application/json; charset=utf-8');
}

sub filter_artist_releases_form : Local {
my ($self, $c) = @_;

my $artist_id = $c->req->query_params->{artist_id};
create_artist_releases_form($c, $artist_id);
my $form = create_artist_releases_form($c, $artist_id);

$c->stash(template => 'components/filter-form.tt');
$c->res->body(encode_json($form->TO_JSON));
$c->res->content_type('application/json; charset=utf-8');
}

sub filter_artist_recordings_form : Local {
my ($self, $c) = @_;

my $artist_id = $c->req->query_params->{artist_id};
create_artist_recordings_form($c, $artist_id);
my $form = create_artist_recordings_form($c, $artist_id);

$c->stash(template => 'components/filter-form.tt');
$c->res->body(encode_json($form->TO_JSON));
$c->res->content_type('application/json; charset=utf-8');
}

1;

0 comments on commit b8c5a33

Please sign in to comment.