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

Create Score command #26

Open
mrbiggred opened this issue Jun 10, 2021 · 0 comments
Open

Create Score command #26

mrbiggred opened this issue Jun 10, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mrbiggred
Copy link
Contributor

mrbiggred commented Jun 10, 2021

Spawned from #23 and depends on #25 being completed first.

We would like to use Freshli in continuous integration (CI) builds to calculate the Freshness score of the project for the commit being built. To do this we will need a Freshli-CLI to return a Freshness score for the current commit which the Freshli-CLI does not support.

The command should look something like:

freshli-cli score [threshold] [--directory directory]

The score command will analysis dependencies in the current directly, or in the directory argument, and return a Freshness score. The Freshness score will be a single number that represents the Freshness for the entire directory. For example if the directory has NuGet and NPM packages it will return the score both files combined.

If the Freshness score is greater then then threshold argument the command will fail. For example, if the a project always wants a Freshness score of 10 or less then they would run a command like:

freshli-cli score 10

In a GitHub Action I see using it as:

# Assume .NET 5.0 is installed.
- name: Run Freshli
  run: |
    dotnet tools install freshli-cli
    freshli-cli score 10

If you want the Freshness value to use in a different GitHub action:

- name: Run Freshli
  id: freshli
  run: |
      dotnet tools install freshli-cli
      echo "::set-output name=FRESHNESS::$(freshli-cli score)"

- name: Display Freshness
  run: echo "Freshness: ${{ steps.freshli.outputs.FRESHNESS }}"

I don't think Freshli-Lib currently supports computing just the Freshness score for the currently checked out commit. If not we will have to add the API methods.

@mrbiggred mrbiggred added the enhancement New feature or request label Jun 10, 2021
@mrbiggred mrbiggred added this to the v0.4.0 milestone Jun 10, 2021
@mrbiggred mrbiggred modified the milestones: v0.4.0, v0.5.0 Jun 10, 2021
@mscottford mscottford removed this from the v0.5.0 milestone Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Icebox
Development

No branches or pull requests

3 participants