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

Communities update #23

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If both `--read-metadata` and `--file` are used, then IGA does not actually cont

## InvenioRDM communities

To submit your record to a community, use the `--community` option together with a community name. The option `--list-communities` can be used to get a list of communities supported by the InvenioRDM server. Note that submitting a record to a community means that the record will not be finalized and will not be publicly visible when IGA finishes; instead, the record URL that you receive will be for a draft version, pending review by the community moderators.
To submit your record to a community, use the `--community` option together with a community identifier. IGA supports the "friendly" community identifier that is found at the end of the comunity url (e.g., `"tccon"`). The option `--list-communities` can be used to get a list of communities supported by the InvenioRDM server. Note that submitting a record to a community means that the record will not be finalized and will not be publicly visible when IGA finishes; instead, the record URL that you receive will be for a draft version, pending review by the community moderators.

## Draft vs. published records

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ A [GitHub Actions](https://docs.github.com/en/actions) workflow is an automated
```{literalinclude} ../sample-workflow.yml
:language: yaml
```
3. **Edit the value of the `INVENIO_SERVER` variable near the top of the file above** ↑
3. **Edit the value of the `INVENIO_SERVER` variable near the top of the file above** ↑. For CaltechDATA the value should be `https://data.caltech.edu`.
4. Optionally, change the [values of other options (`parent_record`, `community`, etc.)](https://caltechlibrary.github.io/iga/gha-usage.html#input-parameters)
5. Save the file, commit the changes to git, and push your changes to GitHub

Expand Down
2 changes: 1 addition & 1 deletion iga/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _list_communities(ctx, param, value):
table.add_column('Title', style='medium_turquoise')
table.add_column('Web page', style='light_cyan3', no_wrap=False)
try:
for community in sorted(invenio_communities().values()):
for community in invenio_communities().values():
tmorrell marked this conversation as resolved.
Show resolved Hide resolved
table.add_row(community.name, community.title,
f'[link={community.url}]{community.url}[/]')
Console().print()
Expand Down
15 changes: 7 additions & 8 deletions iga/invenio.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,18 @@ def invenio_community_send(record, community):
}
result = _invenio('put', url=record.review_url, data=data,
msg='get community submission link from InvenioRDM')
if submit_url := result.get('links', {}).get('actions', {}).get('submit', ''):
data = {
submit_url = record.get('review_url','').replace('/review','/actions/submit-review')
data = {
'payload': {
'format': 'html',
'content': 'This record is being submitted automatically using'
f'the InvenioRDM GitHub Archiver (IGA) version {iga.__version__}',
'content': f'''This record is being submitted automatically using
the InvenioRDM GitHub Archiver (IGA) version
{iga.__version__}''',
}
}
log(f'submitting the record to community {community}')
result = _invenio('post', url=submit_url, data=data,
log(f'submitting the record to community {community}')
result = _invenio('post', url=submit_url, data=data,
msg='submit record to community {community}')
else:
raise InternalError('Unexpected result in community submission step')


def invenio_publish(record):
Expand Down