empd_admin.finish module

Command to finish the merging of a PR

Functions

finish_pr(meta[, commit])

Finish a data contribution to the EMPD

fix_sample_formats(meta[, commit])

Fix the sample formats changing the order, etc.

look_for_changed_fixed_tables(meta, …)

Check whether any of the fixed tables has been changed

merge_meta(meta[, target, commit, local_repo])

Merge one EMPD meta data into another

merge_postgres(meta[, commit])

Merge the new metadata into the EMPD2 postgres database

rebase_master(meta)

Merge the master branch of EMPD2/EMPD-data into the local fork

empd_admin.finish.finish_pr(meta, commit=True)

Finish a data contribution to the EMPD

This functions is supposed to be called at the end of a new data contribution in a github pull request

Parameters
  • meta (str) – The path to the meta file

  • commit (bool) – If True, commit the changes to the git repository of meta

empd_admin.finish.fix_sample_formats(meta, commit=True)

Fix the sample formats changing the order, etc.

Parameters
  • meta (str) – The path to the meta file of the data contribution

  • commit (bool) – If True, commit the changes to the git repository

empd_admin.finish.look_for_changed_fixed_tables(meta, pr_owner, pr_repo, pr_branch)

Check whether any of the fixed tables has been changed

The import of the data contribution into the postgres database might add new entries into the postgres/scripts/tables files. This function checks for this and reports back to the PR

Parameters
  • meta (str) – The path to the meta file of the data contribution

  • pr_owner (str) – The owner (github username) of the data contribution

  • pr_repo (str) – The name of the repository

  • pr_branch (str) – The branch of the data contribution

Returns

The status message to report what happened with the fixed tables

Return type

str

empd_admin.finish.merge_meta(meta, target=None, commit=True, local_repo=None)

Merge one EMPD meta data into another

Parameters
  • meta (str) – The file to merge.

  • target (str) – The file to merge meta into. If None, the meta file of the local_repo is used, and, if this is meta we use meta.tsv.

  • commit (bool) – If True, commit the changes to the git repository

  • local_repo (str) – The path to the EMPD-data local repository. If None, the directory of meta is used

Returns

The target

Return type

str

empd_admin.finish.merge_postgres(meta, commit=True)

Merge the new metadata into the EMPD2 postgres database

Parameters
  • meta (str) – The path to the meta file of the data contribution

  • commit (bool) – If True, commit the changes to the git repository

empd_admin.finish.rebase_master(meta)

Merge the master branch of EMPD2/EMPD-data into the local fork

Parameters

meta (str) – The path to the meta file of the data contribution