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

Dlc purge #869

Merged
merged 8 commits into from
Mar 21, 2023
Merged

Dlc purge #869

merged 8 commits into from
Mar 21, 2023

Conversation

2shortplanks
Copy link
Contributor

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

=======

  • Add support for purging DLC from the command line

Rationale

=========

Users frequently want to purge DLC and ask CircleCI support how they can do so. This adds the functionality to do that from the command line.

Considerations

==============

This functions by using a "/private" url from dl.circleci.com (which was designed explicitly for this purpose). This is not intended to otherwise be a public endpoint, and is subject to change (though this client will update if that ever happens)

  • This client has been designed to determine if the API it's using has been deprecated (i.e. issues a 410 Gone message) and prompt the user to update.
  • A new "client" library was added to talk to dl.circlecli.com (similar to the "project" client, etc). This was based off of "rest" like other clients.
  • Sensible error messages were added if the user tries to use this on server (which cannot purge DLC in the same manner)

Screenshots

============

CleanShot 2023-03-17 at 15 36 43@2x

Here are some helpful tips you can follow when submitting a pull request:

  1. Fork the repository and create your branch from main.
  2. Run make build in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (make test).
  5. The --debug flag is often helpful for debugging HTTP client requests and responses.
  6. Format your code with gofmt.
  7. Make sure your code lints (make lint). Note: This requires Docker to run inside a local job.

All done (including checking for linting!)

AbrahamTewa and others added 8 commits February 22, 2023 16:13
These fields are never read from, so we can delete them.
This code has no effect (the endpoint variable is never used, nor the
value being written back to the struct it came from).
Split the New into two different functions, one that takes exactly what
is needed to create the struct, and another that is able to assemble
these values from the config.
- Also, add code for calling the DLC purge endpoint
@2shortplanks 2shortplanks requested review from a team as code owners March 17, 2023 15:39
@jrahme-cci jrahme-cci merged commit 1e8b8c7 into CircleCI-Public:develop Mar 21, 2023
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.

6 participants