Skip to content

Conversation

@Jasperhino
Copy link
Collaborator

@Jasperhino Jasperhino commented Jan 24, 2024

This PR add tokei as the main analytics tool and changes the frontend metrics format from csv to json

@Jasperhino Jasperhino requested a review from scheibel January 25, 2024 12:33
Dockerfile Outdated
COPY analytics/pnpm-lock.yaml .
COPY analytics/tsconfig.json .
RUN mkdir /metrics
VOLUME ["/metrics"]
Copy link
Member

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?

Copy link
Collaborator Author

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

export default function MetricsPage() {
const { owner, repo, commitSHA, branch } = useParams();

console.log(owner, repo, commitSHA, branch);
Copy link
Member

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?

files: string[] = ["metrics.json"]
): Promise<MetricsBlob[]> {
const ref_string = `metrics/${commit_sha}`;
console.log(ref_string);
Copy link
Member

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 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
Copy link
Member

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.

Copy link
Collaborator Author

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.

@scheibel
Copy link
Member

Looks good to me. Nice updating of the dependencies even across major versions.

@Jasperhino Jasperhino merged commit c34bbc0 into dev Dec 10, 2024
2 checks passed
@Jasperhino Jasperhino deleted the add-tokei branch December 10, 2024 19:59
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