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

Handle the situation when there no tags are present in the repository #464

Closed
tonyo opened this issue May 23, 2023 · 2 comments
Closed

Handle the situation when there no tags are present in the repository #464

tonyo opened this issue May 23, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tonyo
Copy link
Contributor

tonyo commented May 23, 2023

Environment

What version are you running? 1.2.2

Steps to Reproduce

Run craft prepare step on the repository that has no Git tags.

Expected Result

prepare runs successfully.

Actual Result

The following error happened:

Error:  fatal: No names found, cannot describe anything.

  
  at Object.action (/usr/local/bin/craft:549:10630)
  at uMe.exec (/usr/local/bin/craft:549:10942)
  at /usr/local/bin/craft:548:6689
  at new Promise (<anonymous>)
  at lA.handleTaskData (/usr/local/bin/craft:548:6578)
  at lA.<anonymous> (/usr/local/bin/craft:548:6204)
  at Generator.next (<anonymous>)
  at a (/usr/local/bin/craft:545:1507)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Process completed with exit code 1.

It looks like craft prepare fails here when trying to fetch the latest tag from the repository:

const oldVersion = await getLatestTag(git);

...or more specifically, here:

return (await git.raw('describe', '--tags', '--abbrev=0')).trim();

Suggestion

getLatestTag() should not fail if there are no existing tags on the repository. The default return value can be an empty string, for example.

@tonyo tonyo added bug Something isn't working good first issue Good for newcomers labels May 23, 2023
@tonyo
Copy link
Contributor Author

tonyo commented May 23, 2023

Happened today when releasing https://github.com/getsentry/sentry-maven-plugin

@asottile-sentry
Copy link
Member

dupe #342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants