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

Fixes #36581 - Treat indeterminate/nil needs_publish as true in the API #10655

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Jul 17, 2023

What are the changes introduced in this pull request?

When users pass true for publish-only-if-needed param, we should let them publish cv where needs_publish? value is indeterminate(nil). This is consistent with UI behavior where we don't provide a notice to users when publishing a CV if needs_publish is true/indeterminate.

Considerations taken when implementing this change?

What are the testing steps for this pull request?

  1. Create a CV.
  2. Publish.
  3. hammer -r content-view publish --id $id --publish-only-if-needed true
  4. You will see a message saying no changes to publish.
Could not publish the content view:
  Content view does not need a publish since there are no audited changes since the last publish. Pass check_needs_publish parameter as false if you don't want to check if content view needs a publish.
  1. In console, run Audit.delete_all . This creates the indeterminate state for us where we lose audits of all changes.
  2. Publish from hammer with command above. It should let you publish CV.

@theforeman-bot
Copy link

Issues: #36581

@sjha4
Copy link
Member Author

sjha4 commented Jul 18, 2023

[test katello]

@chris1984 chris1984 self-assigned this Jul 18, 2023
Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

ACK, works great.

[vagrant@centos7-hammer-devel ~]$ hammer -r content-view publish --id 2 --publish-only-if-needed true
Could not publish the content view:
  Content view does not need a publish since there are no audited changes since the last publish. Pass check_needs_publish parameter as false if you don't want to check if content view needs a publish.

@sjha4 sjha4 merged commit 945e2e7 into Katello:master Jul 20, 2023
5 checks passed
wbclark pushed a commit to wbclark/katello that referenced this pull request Jul 20, 2023
wbclark pushed a commit to wbclark/katello that referenced this pull request Jul 21, 2023
wbclark pushed a commit that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants