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

Fix: allow operator and violationState to be specified when create policy #2997

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

takumakume
Copy link
Contributor

@takumakume takumakume commented Aug 30, 2023

Description

Allow operator and violationState to be specified when create policy.
In addition, to keep backward compatibility, default values are provided.

Addressed Issue

Closes #2365

The violationState is problematic, but so is the operator.

Additional Details

Currently, sending the operator and violationState parameters is ignored and the hard-coded values are used.

If these are to be changed to other values, a policy update is required, which is inefficient.

This is a problem specific to create policy since it is a required parameter in the model layer.

In order to maintain backward compatibility of create policy, a default value has been added.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@takumakume takumakume changed the title fix: allow operator and violationState to be specified when create policy Fix: allow operator and violationState to be specified when create policy Aug 30, 2023
Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

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

Thanks @takumakume! 🤘

@nscuro nscuro merged commit 15a9baa into DependencyTrack:master Aug 30, 2023
@takumakume takumakume deleted the fix-create-policy-via-api branch September 1, 2023 07:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allowing to set a 'violationState' via API request
2 participants