Annif icon indicating copy to clipboard operation
Annif copied to clipboard

WIP Default disable learn function

Open juhoinkinen opened this issue 9 months ago • 3 comments

The learn functionality is rarely used, so it is best to be disabled by default for API requests.

This pull request introduces a new feature that restricts learning operations on projects unless explicitly enabled with allow_learn project config parameter.

Adds a new 403 response in the OpenAPI specification for trying to access the /v1/<project>/learn when the project is not configured to allow this.

juhoinkinen avatar Apr 01 '25 08:04 juhoinkinen

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 99.64%. Comparing base (38f5e8a) to head (39d2a8c). :warning: Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #843      +/-   ##
==========================================
+ Coverage   99.63%   99.64%   +0.01%     
==========================================
  Files          99       99              
  Lines        7350     7361      +11     
==========================================
+ Hits         7323     7335      +12     
+ Misses         27       26       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Apr 01 '25 08:04 codecov[bot]

The existing visibility settings only affect the REST API. I think this could also be scoped the same way; the CLI probably shouldn't care about this setting.

osma avatar Apr 01 '25 09:04 osma