Skip to content

Revert "Remove redundant rake task [WHIT-2999]"#11127

Open
catalinailie wants to merge 2 commits intomainfrom
revert-11089-remove-one-time-rake-task
Open

Revert "Remove redundant rake task [WHIT-2999]"#11127
catalinailie wants to merge 2 commits intomainfrom
revert-11089-remove-one-time-rake-task

Conversation

@catalinailie
Copy link
Contributor

Reverts #11089

We will need this task for unpublishing more statistics announcements

Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

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

Maybe we should keep this around for a while 😅

Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

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

Not sure if we want to redirect these or just mark them gone?

#
task :unpublish_and_redirect, %i[file redirect_url] => :environment do |_task, args|
file = args[:file]
redirect_url = args[:redirect_url]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this what we want, to redirect all the announcements to a single URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. No, we need different redirect URL for each announcement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't checked all of them, but is it possible to unpublish without providing a redirect url?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you can send an unpublish request to Publishing API with a type value of "gone". See https://docs.publishing.service.gov.uk/repos/publishing-api/api.html#post-v2contentcontent_idunpublish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked over the announcements and all of them have a publication. So I just tweaked a bit the task to accept a redirect url for each statistics announcement id

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.

2 participants