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

Fix: Throws error if tag does not contains "version" property #272

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

erayhanoglu
Copy link
Contributor

If any tag object does not contains "version" property it throws error. This patch fixes this issue

If any tag object does not contains "version" property it throws error. This patch fixes this issue
@Noyan759
Copy link

Much needed fix!!

@Noyan759
Copy link

Hey @erayhanoglu
Since the PR is taking too long, did you manage to get around this issue in the meantime?

@webketje
Copy link
Contributor

webketje commented Feb 28, 2024

@erayhanoglu were you working with non-semver-conforming tags? I think the interesting question is why the tag doesn't have a version property in the first place, and whether that is even the correct assumption. The PR is ok IMO, but does not address the underlying issue. Extra info about the error would be welcome. When I look at https://github.com/cookpete/auto-changelog/blob/master/src/tags.js, it looks impossible that the version property is undefined on the line your proposed to change (the code would then throw earlier).

It looks like something like this happened:

  1. --starting-version is used OR options.appendGitTag contains a string that unexpectedly alters the git tag output
  2. The version passed to --starting-version is not included in the parsed, enriched tags (because it does not exist, is not a valid semver tag, or does not match --tag-pattern).
  3. The full list of tags contains tags that do not have the version property, e.g. because they are matched by --tag-pattern but only partially matched by --tag-prefix, or

@erayhanoglu
Copy link
Contributor Author

Hi @webketje. It has been to long to remember the issue that i faced. I always use semver in my projects. If i am not wrong i ve faced the issue in postgresql-client repository. You may check it.

@webketje
Copy link
Contributor

@erayhanoglu if it was on that repo, the issue is that you are not using git tags - you are only creating commits with a semver-compliant commit message... Still auto-changelog should not error on a "virgin" repo without tags, and the fetchTags fucntion should definitely not parse an invalid tag

@cookpete cookpete merged commit 7a0943f into cookpete:master Sep 11, 2024
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.

4 participants