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

Remove version from generated header #875

Closed
wants to merge 2 commits into from
Closed

Conversation

marians
Copy link
Member

@marians marians commented Mar 25, 2024

This change removes the version number from the generated header.

Before this, many "Align files" PRs consist of meaningless changes like this one:

image

Checklist

  • Update changelog in CHANGELOG.md.

@marians marians self-assigned this Mar 25, 2024
@marians marians marked this pull request as ready for review March 25, 2024 11:06
@marians marians requested a review from a team as a code owner March 25, 2024 11:06
Copy link
Contributor

@lyind lyind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, I also noticed the clutter. But, might there have been a reason to add the version?

Anyways, LGTM

@ubergesundheit
Copy link
Member

I want to voice my opinion without approving nor blocking this PR.

I agree the Align files PRs are annoying but I find the explicit version in the header helps me to identify if the auto-generated files are up to date or not. Without a version string I'll probably re-run devctl more often locally on my machine to verify if everything is using the latest versions.

A possible alternative would be versioned templates. So devctl can be updated independently from the actual version of the template. So the header would not include the devctl version but the version of the template.

@lyind
Copy link
Contributor

lyind commented Mar 25, 2024

A possible alternative would be versioned templates. So devctl can be updated independently from the actual version of the template. So the header would not include the devctl version but the version of the template.

This is a very good suggestion, IMHO.

@marians
Copy link
Member Author

marians commented Mar 26, 2024

Would that be a Semver per template, or rather just an integer to increment with every change, or a last modified date?

@ubergesundheit
Copy link
Member

Last modified date sounds good. A commit hash could be also useful for people wanting to see the who and why something in a template was changed.

@marians
Copy link
Member Author

marians commented Mar 26, 2024

The problem with a commit hash is that it only exists after the change was made. So I'd favour a last modified date.

@ubergesundheit
Copy link
Member

In my mind it could work like this: Like opsctl, devctl would load the templates from a repository during runtime. The information (hash + last modified date) would be available then

@marians
Copy link
Member Author

marians commented Mar 26, 2024

In my mind it could work like this: Like opsctl, devctl would load the templates from a repository during runtime. The information (hash + last modified date) would be available then

IMO the chain of dependencies grows a bit long for what it's trying to accomplish.

  • "Align files" PR in the repo is made by the Synchronize workflow in giantswarm/github
  • Synchronize workflow used devctl
  • devctl references specific template, based on what file it tries to generate.

Currently we already need three PRs (giantswarm/devctl, giantswarm/github and the target repo) to push a change through to the target repo.

@ubergesundheit
Copy link
Member

Doesn't keeping templates in a separate repo and loading the repo inside devctl free us of doing the devctl and github PRs? assuming devctl is compatible.

@ubergesundheit
Copy link
Member

Anyone working on this and is ready soon? Otherwise I want to try implementing this using //go:generate directives while keeping templates in the same repo

@marians
Copy link
Member Author

marians commented Apr 3, 2024

@ubergesundheit Please go ahead! I was up for the minimal change this PR brings, but don't see me doing the other approach.

@marians marians closed this Apr 3, 2024
@marians marians deleted the remove-version-from-header branch April 3, 2024 13:23
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.

None yet

3 participants