8000 agents, concepts: better changed api by rerowep · Pull Request #114 · rero/rero-mef · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

agents, concepts: better changed api #114

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

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

rerowep
Copy link
Contributor
@rerowep rerowep commented Nov 15, 2022
  • Adds resolve to POST parameter.
  • Without resolve only pid, _created, _updated and `deleted`` will be returned.
  • Are unknown pids will be reported back without additional information. Example `{'pid', '42'}

Co-Authored-by: Peter Weber peter.weber@rero.ch

@rerowep rerowep requested a review from jma November 15, 2022 10:35
@rerowep rerowep self-assigned this Nov 15, 2022
@rerowep rerowep force-pushed the wep-better-updated branch 6 times, most recently from f4b0254 to c8dd2de Compare November 15, 2022 11:38
@coveralls
Copy link
coveralls commented Nov 15, 2022

Coverage Status

Coverage increased (+0.07%) to 73.245% when pulling c1e83db on rerowep:wep-better-updated into a89ed83 on rero:staging.

@rerowep rerowep force-pushed the wep-better-updated branch 2 times, most recently from d3554ca to 136cdd1 Compare November 16, 2022 08:17
# find deleted pids
missing_pids = []
for pid in pids:
if cls.search().filter('term', pid=pid).count() == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably be optimized.

missing_pids.append(pid)
for missing_pid in missing_pids:
data = {'pid': missing_pid}
mef = cls.get_record_by_pid(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get using id instead of pid for performance purpose.

'api_blueprint.agent_mef_get_updated',
{'resolve': 1}
)
assert res.status_code == 200
pids = sorted([rec.get('pid') for rec in data])
assert pids == ['1', '2', '3']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not robust.

res, data = postdata(
client,
'api_blueprint.agent_mef_get_updated',
{"from_date": date.isoformat(), "pids": ['2', '4']}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not robust. Do not use contant values if it is possible.

* Adds `resolve` to POST parameter.
* Without `resolve` only `pid`, `_created`, `_updated` and `deleted``
  will be returned.
* Are unknown pids will be reported back without additional
  information. Example `{'pid', '42'}
* dependencies updates
* changes ci node to version 14

Co-Authored-by: Peter Weber <peter.weber@rero.ch>
@rerowep rerowep merged commit 9202486 into rero:staging Nov 21, 2022
@rerowep rerowep deleted the wep-better-updated branch November 21, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0