Giter Club home page Giter Club logo

gitlab-pipeline-deleter's Introduction

gitlab-pipeline-deleter

GitHub Actions status

A Node.js CLI tool that deletes old GitLab CI pipelines.

Installation

$ npm install -g gitlab-pipeline-deleter

Usage

Usage: glpd [options] [gitlab-url] [project-id] [access-token]

Deletes old GitLab pipelines

Options:
  -d --days <days>  older than days (default: "30")
  --trace           show stack traces for errors when possible (default: false)
  -h, --help        display help for command

You can use either the command line arguments gitlab-url, project-id and access-token (the access-token needs to be owner of the project. See https://docs.gitlab.com/ee/api/pipelines.html#delete-a-pipeline for more information) or you can create a glpd.config.js configuration file that exports an object. Both CommonJS (.cjs) and ECMAScript Modules (.mjs) are supported. All of the command line arguments are supported but needs to be written in camelCase:

export default {
    gitlabUrl: 'https://example.com',
    projectId: '42',
    accessToken: '<my-token>',
    days: 30,
    trace: false,
};

If you specify command line arguments and a configuration file the command line arguments will overwrite the values in the configuration file. So the CLI arguments has always precedence.

Multiple project ids can be configured by providing a comma-separated list to the projectId argument.

gitlab-pipeline-deleter's People

Contributors

lo1tuma avatar renovate-bot avatar renovate[bot] avatar screendriver avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gitlab-pipeline-deleter's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Pending Branch Automerge

These updates await pending status checks before automerging. Click on a checkbox to abort the branch automerge, and create a PR instead.

  • Update dependency prettier to v3.3.1

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
npm
package.json
  • @sindresorhus/is 6.3.1
  • commander 11.1.0
  • cosmiconfig 9.0.0
  • date-fns 2.30.0
  • got 14.3.0
  • ink 4.4.1
  • ink-spinner 5.0.0
  • p-queue 7.4.1
  • react 18.3.1
  • true-myth 7.3.0
  • tslib 2.6.3
  • zod 3.23.8
  • @ava/typescript 5.0.0
  • @types/common-tags 1.8.4
  • @types/node 20.14.2
  • @types/react 18.3.3
  • @types/sinon 17.0.3
  • @typescript-eslint/eslint-plugin 7.12.0
  • @typescript-eslint/parser 7.12.0
  • auto-changelog 2.4.0
  • ava 6.1.3
  • c8 9.1.0
  • delay 6.0.0
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-plugin-ava 14.0.0
  • eslint-plugin-prettier 5.1.3
  • eslint-plugin-react 7.34.2
  • eslint-plugin-react-hooks 4.6.2
  • eslint-plugin-testing-library 6.2.2
  • fastify 4.27.0
  • fishery 2.2.2
  • ink-testing-library 4.0.0
  • jscpd 3.5.10
  • prettier 3.3.0
  • release-it 17.3.0
  • sinon 18.0.0
  • typescript 5.4.5
  • node >=16

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

filter pipelines by scope

I want to not delete pipelines associated with tags.

The inverse list of /projects/:id/pipelines?scope=tags

The branches scope is probably close enough: /projects/:id/pipelines?scope=branches

Can I do that without hacking at the module code?

0 days does not remove all pipelines

0 days in the config:

module.exports = {
    gitlabUrl: 'https://gitlab.com',
    projectId: '1',
    accessToken: 'GLPAT_xyz',
    days: 0,
    trace: false,
};

always results in 0 pipelines found. Any pipelines less than a day old cannot be deleted.

It seems a small change in gitlab.tx isOlderThanDays would allow this.

`glpd.config.js` is mandatory

I tried to run glpd without a config file and it ended up dying silently with:

Missing or invalid arguments

Doing a console.log on the arguments showed:

/ # /usr/local/bin/glpd --days=800 https://gitlab.com 1337 hahahaha
Err {
  variant: 'Err',
  error: "ENOENT: no such file or directory, open '/glpd.config.js'"
}

So maybe we should state that the config file at glpd.config.js in cwd is necessary or make it optional. What do you think?

Use of mutation testing in gitlab-pipeline-deleter - Help needed

Hello there!

My name is Ana. I noted that you use the mutation testing tool StrykerJS in the project.
I am a postdoctoral researcher at the University of Seville (Spain), and my colleagues and I are studying how mutation testing tools are used in practice. With this aim in mind, we have analysed over 3,500 public GitHub repositories using mutation testing tools, including yours! This work has recently been published in a journal paper available at https://link.springer.com/content/pdf/10.1007/s10664-022-10177-8.pdf.

To complete this study, we are asking for your help to understand better how mutation testing is used in practice, please! We would be extremely grateful if you could contribute to this study by answering a brief survey of 21 simple questions (no more than 6 minutes). This is the link to the questionnaire https://forms.gle/FvXNrimWAsJYC1zB9 .

We apologize if you have already received message multiple times or if you have already had the opportunity to complete the survey. If you have already shared your feedback, we want to convey our appreciation, kindly disregard this message, and please accept our apologies for any inconvenience.

Drop me an e-mail if you have any questions or comments ([email protected]). Thank you very much in advance!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.