question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not a bug, just need help getting started...

See original GitHub issue

First time user here. I really love the idea of shipjs, just can’t seem to get it running properly. This isn’t a bug, just need some guidance, and can’t seem to find answers in either the documentation or on GitHub.

Describe the bug I’m trying out shipjs on a new website project, that project repo is here where you can see my configs, etc. I’ve followed documentation as best I can to create a flow where shipjs > tests the build with travisci > deploys to vercel (now). I’ve created two releases, both in which I’ve seen a number of things I didn’t expect (assuming I’m doing something wrong?).

Unexpected behaviors from shipjs prepare:

  1. Git tags: Whenever i run shipjs prepare (via my npm run pr script), I get a Git tag 'v1.0.0' doesn't exist., which would be expected, since I haven’t released yet.

  2. From which commit…: It then asks me From which commit do you want to release?. I would have assumed, since it’s my first release, it would go from the very first commit. Even on the 2nd release attempt, it still asked me this question (I assume because the first release did not work correctly). Each time I manually selected the first commit.

  3. All commit messages are “out of convention”: Every time it tells me The following commit messages out of convention are ignored:, and lists all of my commit messages. This is strange to me, because I am using commitlint, which follows conventional commit standards.

  4. Version: It detects a minor version bump each time. I would assume, since it’s the first release, it would release 1.0.0.

  5. PR: The command does create the PR, but it only adds the changelog and version change in package.json to the PR; it doesn’t add any other files (maybe its skipping all the commits bc of “out of convention” comit messages?). Also, it does not add any of the commits that were “out of convention” to the changelog, so only has one commit message there (I manually added some commit messages to CHANGELOG.md in the first release).

Merging the PR goes as I would expect, but then there are some unexpected behaviors when I run the shipjs trigger command…

Unexpected behaviors from shipjs trigger:

  1. I have Travis CI configured to run shipjs trigger (via the npm run release script), and the command does get triggered as expected. However, each time, it successfully ends with the message: Skipping a release due to the following reason: > The current branch needs to be one of [master], even though it is on the master branch. Not sure why that might happen.

To Reproduce Steps to reproduce the behavior:

  1. Clone the project repo.
  2. Run npm run pr or npx shipjs prepare and you will see the issues described above from the prepare command.
  3. Trigger a Travis CI build release and you will see the issues described above from the trigger command.

Expected behavior See “Describe the bug”.

Screenshots Log from shipjs prepare command (ran in --dry-run mode):

##########################
#                        #
#   This is a dry-run!   #
#                        #
##########################

› Checking GITHUB_TOKEN
› Checking the current status.
› Validating mergeStrategy.
› Updating from remote.
$ git pull origin master
› Fetching tags.
$ git fetch --tags
› Pushing to remote.
    $ git remote add origin-with-token https://xxx@github.com/thezimmee/tysonzimmerman.com
$ git push origin-with-token master
› Getting a revision range for this release.
Git tag 'v1.0.1' doesn't exist.
? From which commit do you want to release? 21) 930ff59 feature(build): Aut
omate code QA on staged files.
  930ff59..HEAD
› Calculating the next version.
The following commit messages out of convention are ignored:
  feature: Update font family in blog/posts to serif.
  build: Ignore css stats folder.
  feature(blog): Add basic content on /blog page.
  feature(posts): Share, follow, and comments features for blog posts.
  feature(latest): Add latest posts on home page.
  feature(browsersync): Have Bundles initialize browsersync, but not reload it.
  feature(home): Complete home page profile section and basic feature set.
  feature(css): Style global header and footer.
  feature(css): Output PostCSS sourcemaps.
  feature(babel): Babel bundler, especially for performant local development.
  feature(pages): MVP features for static site generator...
  feature(release): Add ability to release with ShipJS.
  feature(build): Add eleventy and parcel.
  feature(testing): Add jest, playwright, and jest-image-snapshot to write all kinds of tests.
› Confirming the next version.
The current version: 1.0.1
The next version: 1.0.2
› Preparing a staging branch
› Checking out to the staging branch.
$ git checkout -b releases/v1.0.2
› Updating the version.
-> package.json
› Installing the dependencies.
$ npm install
› Updating the changelog.
› Committing the changes.
$ git add .
$ git commit
  |
  | chore: release v1.0.2
  |
› Pushing to remote staging branch.
    $ git remote add origin-with-token https://xxx@github.com/thezimmee/tysonzimmerman.com
$ git push origin-with-token releases/v1.0.2
› Creating a pull request.
$ git remote prune origin
Creating a pull request with the following:
  - Title: chore: release v1.0.2
  - Message: ## Release Summary
- Version change: `v1.0.1` → `v1.0.2`
- Merge: `releases/v1.0.2` → `master`
- [Compare the changes between the versions](https://github.com/thezimmee/tysonzimmerman.com/compare/v1.0.1...releases/v1.0.2)
> :warning: When merging this pull request, you need to **_"Squash and merge"_** and make sure the title starts with `chore: release v1.0.2`.
> After that, a commit `chore: release v1.0.2` will be added and `shipjs trigger` will be able to trigger the release based on the commit.
> Fore more information, please refer to the mergeStrategy section of the [guide](https://community.algolia.com/shipjs/guide/useful-config.html#mergestrategy).
> ![Squash and merge](https://raw.githubusercontent.com/algolia/shipjs/v0.18.2/assets/squash-and-merge.png)

---
This is going to be published by the following command:
\```
npx now
\```
---
_This pull request is automatically generated by [Ship.js](https://github.com/algolia/shipjs)_
› All Finished.

Travis CI logs from running shipjs trigger

Environment (please complete the following information):

  • environment: local machine with shipjs prepare, Travis CI with shipjs trigger
  • node -v: v13.6.0
  • npm -v or yarn -v: 6.14.5
  • Ship.js version: 0.18.2

Additional context Please let me know if you need any other information. I’d like to not have to abandon shipjs, just need to figure this out sooner than later. Thank you in advance!!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thezimmeecommented, May 14, 2020

Thanks @eunjae-lee, much appreciated. When I have some time I will do what you suggested and create a test repo to get familiar with Ship.js. For now I’ll close this issue, and if/when I’m able do that I’ll reopen if I have any issues. FWIW it would be nice to be able to customize commit message convention, I use commitlint, which follows Conventional Commits but makes it easy to tweak to your needs.

Thanks again for your help!

0reactions
eunjae-leecommented, May 14, 2020

Hi there, first of all, Ship.js is following Conventional Commits. That spec has feat, but not feature. That’s why you’re getting those warnings. At the moment it’s not configurable. Unfortunately you need to rename your commits by using git rebase. If you’re not sure yet, then I recommend you to create an empty git repository with just one or two files and try Ship.js there first to get familiar with the whole process.

shipjs trigger runs git rev-parse --abbrev-ref HEAD to get current branch name. If it’s not properly ran, you may need to check what that command returns on TravisCI.

It’s normal that release PR contains only version update and changelog update when you’re using toSameBranch strategy.

Once you successfully run all the flow until shipjs trigger, then next time you run shipjs prepare, it won’t complain about the git tag missing.

I may have not covered all your questions, but let me know after you tackle all the things above. I’m happy to help you onboard!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'It's Not a Bug, It's a Feature.' Trite—or Just Right? - WIRED
“That's not a bug, that's a feature!” is a common catchphrase. When 19th-century inventors and engineers started using bug as a synonym for...
Read more >
A feature not a bug | English expression meaning
A feature, not a bug” describes something that seems like a flaw, but is in fact intentional. Netflix now requires text verification to ......
Read more >
How to find your first open source bug to fix - freeCodeCamp
A good place to start your bug hunt is Up For Grabs. The whole purpose of the site is to help new contributors...
Read more >
What is a bug (computer bug)? - TechTarget
A bug is just one kind of problem that a program can have. Programs can run bug-free and still be difficult to use...
Read more >
How to fix a bug in open source software | Opensource.com
Getting started. First up, consider open source software you use. · Stale issues. Issues have a shelf life. · Regressions · Trust but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found