-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add tokei #43
Add tokei #43
Conversation
Dockerfile
Outdated
@@ -10,11 +10,15 @@ COPY analytics/src ./src | |||
COPY analytics/package.json . | |||
COPY analytics/pnpm-lock.yaml . | |||
COPY analytics/tsconfig.json . | |||
RUN mkdir /metrics | |||
VOLUME ["/metrics"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is an anonymous volume beneficial here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not for now, removed it
@@ -5,7 +5,7 @@ import RepoBreadcrumbs from "./RepoBreadcrumbs"; | |||
|
|||
export default function MetricsPage() { | |||
const { owner, repo, commitSHA, branch } = useParams(); | |||
|
|||
console.log(owner, repo, commitSHA, branch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or comment out debugging information?
frontend/src/utils/github.ts
Outdated
): Promise<MetricsBlob[]> { | ||
const ref_string = `metrics/${commit_sha}`; | ||
console.log(ref_string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or comment out debugging information?
Dockerfile
Outdated
|
||
RUN pnpm install | ||
RUN pnpm run build | ||
|
||
RUN curl -vL --compressed https://github.com/XAMPPRocky/tokei/releases/download/v12.1.2/tokei-x86_64-unknown-linux-gnu.tar.gz --output tokei.tar.gz | ||
RUN tar -xvf tokei.tar.gz | ||
RUN ./tokei /repository --output json > /metrics/metrics.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, it's not clear how this run of tokei will result in a software project being analyzed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we run a checkout action before running our action we will have copied the whole repository to be analysed into our own action Docker container under /repository at build time. we then also just compute metrics into a json at build time and use this file as an artifact to upload as a blob to the git refs and decode and use in the frontend.
This is arguably not the best solution as it does not allow for caching and reusing the image built for this action. Maybe we can get around this issue by mounting a volume instead in the future.
Looks good to me. Nice updating of the dependencies even across major versions. |
This PR add tokei as the main analytics tool and changes the frontend metrics format from csv to json