Not a bug, just need help getting started...
See original GitHub issueFirst 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
:
-
Git tags: Whenever i run
shipjs prepare
(via mynpm run pr
script), I get aGit tag 'v1.0.0' doesn't exist.
, which would be expected, since I haven’t released yet. -
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. -
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. -
Version: It detects a minor version bump each time. I would assume, since it’s the first release, it would release
1.0.0
. -
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
:
- I have Travis CI configured to run
shipjs trigger
(via thenpm 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:
- Clone the project repo.
- Run
npm run pr
ornpx shipjs prepare
and you will see the issues described above from theprepare
command. - 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 withshipjs trigger
node -v
:v13.6.0
npm -v
oryarn -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:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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!
Hi there, first of all, Ship.js is following Conventional Commits. That spec has
feat
, but notfeature
. 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 runshipjs 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!