Skip to content

Conversation

@liviutomoiaga
Copy link
Contributor

@liviutomoiaga liviutomoiaga commented Feb 9, 2026

Add a clean-cloudsmith job to pr-closed.yml that removes PR artifacts from Cloudsmith when a PR is merged or closed.

Uses wiki-scripts/cloudsmith_helper.py remove_item_from_location method to delete all packages matching the PR version pattern.

PR Description

  • Please replace this comment with a summary of your changes, and add any context
    necessary to understand them. List any dependencies required for this change.
  • To check the checkboxes below, insert a 'x' between square brackets (without
    any space), or simply check them after publishing the PR.
  • If you changes include a breaking change, please specify dependent PRs in the
    description and try to push all related PRs simultaneously.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@liviutomoiaga liviutomoiaga force-pushed the ci-add-cloudsmith-cleanup-on-pr-close branch 2 times, most recently from 40363d2 to d074040 Compare February 10, 2026 08:07
@liviutomoiaga liviutomoiaga marked this pull request as ready for review February 10, 2026 08:08
Copy link
Collaborator

@stefpopa stefpopa left a comment

Choose a reason for hiding this comment

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

Just a couple of questions. Feel free to disagree!

Copy link
Collaborator

@stefpopa stefpopa left a comment

Choose a reason for hiding this comment

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

One more small question and as a note, you can fill the PR description in the future.


clean-cloudsmith:
runs-on: [self-hosted, repo-only]

Copy link
Collaborator

Choose a reason for hiding this comment

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

one more question about this: should we explicitly set permissions? Looking at other jobs in main.yml or top-level.yml, every single job explicitly sets permissions. I don't know what the permission level should be set here, maybe read would be enough?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Permission are required, in particular we need to pass checks-ids (or like that) for OICD to work.
We must explicitly pass secrets as well, because there is a subtle difference between this org and the enterprise, for enterprise, secrets inherit does not work (pass secrets), so we end-up with here working, and in the mirror failing!

Add a clean-cloudsmith job to pr-closed.yml that removes
PR artifacts from Cloudsmith when a PR is merged or closed.

Uses wiki-scripts/cloudsmith_helper.py remove_item_from_location
method to delete all packages matching the PR version pattern.

Signed-off-by: Liviu Tomoiaga <Liviu.Tomoiaga@analog.com>
@liviutomoiaga liviutomoiaga force-pushed the ci-add-cloudsmith-cleanup-on-pr-close branch from d074040 to c2d548f Compare February 10, 2026 10:39
Copy link
Collaborator

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

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

This will run at the enterprise mirror!
The enterprise mirror does not have azure attached.
you must explicitly match === analogdevicesinc

Comment on lines 6 to 14
clean-gh-pages:
runs-on: [self-hosted, repo-only]
permissions:
contents: write

steps:
- uses: analogdevicesinc/doctools/gh-pages-rm-path@action
with:
path: pull/${{ github.event.number }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This whole step shouldn't exist anymore,
we removed doc.yaml at
150ad9a#diff-7871fa1d10e6bf511d9cfda5a6874d1a75acb950fb1bc9fee6057eff13257521

I will open a pull request

Copy link
Collaborator

Choose a reason for hiding this comment

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

@gastmaier
Copy link
Collaborator

gastmaier commented Feb 10, 2026

Overall, I believe we should aim to have retention of artifacts instead of erasing on pr-close

60 days && pr-state is closed

branch main

2 years

tags

never

etc

it is simpler to implement at scale

@liviutomoiaga
Copy link
Contributor Author

Overall, I believe we should aim to have retention of artifacts instead of erasing on pr-close

60 days && pr-state is closed

branch main

2 years

tags

never

etc

it is simpler to implement at scale

Implementation of a Retention Policy is something that definitive we can agree on. I have the same opinion about this. And as far as I know, on sdg_linux, sdg_linux_rpi (and also linux ?) there are no retention policies set. Maybe we can agree on a set of rules based on the documentation .

About deleting a cloudsmith atefact if the pr-state is closed - for this I think we still need a post action that is triggered on an close PR event. I do not think that Cloudsmith has a hook that could be leverage for this purpose.

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