Can Major version changes (aka Breaking Changes) be handled in semantic-release using the exclamation mark?
git commit -m 'feat!: this is breaking, but is not recognized by semantic-release'
Conventional Commit guidelines show that breaking changes can be labeled in the footer in using an exclamation mark in the header.
This is the workflow that I have been testing
Setup repository ✓
git init
git remote add origin git#github.com:klueless-io/k_genesis.git
git branch -M main
git add .
git commit -am 'first commit'
# Artificial starting version number
git tag v0.0.18 -a -m 'k_genesis initialize repository'
git push -u origin main --tags
git hist
Remove a single file and call it a new feature ✓
rm a1
git add .
git commit -m 'feat: remove a1'
git hist
npx semantic-release --no-ci
git hist
Now Breaking Change using Footer Message ✓
This does not work as expected
rm a2
git add .
git commit -m 'feat: removed a2
BREAKING CHANGE: break dancing
'
git hist
npx semantic-release --no-ci
Looking Good So Far ✓
Now try a breaking change using ! exclamation mark ✗ :( :( :(
rm a3
git add .
git commit -m 'feat!: removed a3 with exclamation in header'
npx semantic-release --no-ci
# Analysis of 1 commits complete: no release
git hist
touch xmen
git add .
git commit -m 'feat: normal feat'
npx semantic-release --no-ci
git hist
Attempted custom configurations
I have used the default preset for "#semantic-release/commit-analyzer" (angular) and I have tried a custom preset (conventionalcommits)
my .releaserc
{
"branches": [
"main"
],
"plugins": [
"#semantic-release/commit-analyzer", {
"preset": "conventionalcommits"
}
]
}
Looking a the source code
When I looked at the source code conventional-changelog-conventionalcommits it seamed like breaking change in header should be supported.
You need to manually configure it in .releaserc:
YAML
branches:
- main
plugins:
- - "#semantic-release/commit-analyzer"
- preset: conventionalcommits
releaseRules:
- type: '*!'
release: major
JSON
{
"branches": [
"main"
],
"plugins": [
[
"#semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "*!",
"release": "major"
}
]
}
]
]
}
Related
If I have the following tags and manifest in an ACR repository...
Which returns the following when I run the following command...
az acr repository show-manifests --name "[registry-name]" --repository "[repository-name]"
[
{
"digest": "sha256:30be2b07e723b0f36fed370c386b027e52dbcd0ad2ad2fcac1d3b7d1b361292f",
"tags": [
"982878",
"master"
],
"timestamp": "2022-09-07T15:49:04.4187041Z"
}
]
When I run the following purge command....
az acr run --cmd "acr purge --filter '[repository-name]:.*' --untagged --ago 1m" --registry [registry-name] /dev/null
It is deleting the tags and manifest, and because it deletes everything the repository is deleted as well.
Why is it doing this when I'm using the --untagged flag and you can clearly see it's not untagged based on the starting state?
I have tried to reproduce the same in my environment
I have two repositories ,hello-world with 1 tag: latest
I checked with below command which you tried:
PURGE_CMD="acr purge --filter 'hello-world:.*' \
--untagged –ago 1m"
az acr run \
--cmd "$PURGE_CMD" \
--registry myregistry807 \
/dev/null
It is deleting even the tagged repository
This command:
az acr run --cmd "acr purge --filter 'hello-world:.*' --untagged --ago 1d" --registry myregistry807 /dev/null
It is deleting the tags first, and then it is deleting the untagged manifests and then the registry.
You can check this Purge tags and manifests-run-in-an-on-demand-task - Azure Container Registry | Microsoft Docs:
This purge command deletes all image tags and manifests in the
repository (hello-world in my case) repository in myregistry that were
modified more than 1 day ago and all the untagged manifests.
You can try below commands to delete untagged repositories: Commands
from Delete all untagged manifests within a repository in one
command · GitHub where you can use [?tags[0]==null] to delete
only repos with no tag or null tag.
In bash:
az acr repository show-manifests -n myregistry807 –repository targetrepository --query "[?tags[0]==null].digest" -o tsv | xargs -I% az acr repository delete -n myregistry807 -t targetrepository #% --yes
for preview version:
az acr manifest list-metadata -r myregistry807 -n hello-world --query "[?tags[0]==null].digest" -o tsv | xargs -I% az acr repository delete -n myregistry807 -t hello-world#% --yes
and repository is not deleted as it has tags.
then i checked with [?tags[0]!=null] to delete all tags except null, and it successfully worked for me:
Result: deleted tagged manifest which is the only one present:
I'm trying to see if I can contribute a fix to a couple of issues we've been having with full calendar.
I've cloned the full calendar repo using git clone --recursive git://github.com/fullcalendar/fullcalendar.git and run yarn install.
I've gone into our project used npm link to link up the packages like so:
npm link \
~/dev/fullcalendar/packages/common \
~/dev/fullcalendar/packages/core \
~/dev/fullcalendar/packages/interaction \
~/dev/fullcalendar/packages-premium/premium-common \
~/dev/fullcalendar/packages-premium/resource-common \
~/dev/fullcalendar/packages-premium/resource-timeline \
~/dev/fullcalendar/packages-premium/scrollgrid \
~/dev/fullcalendar/packages-premium/timeline \
~/dev/fullcalendar/packages-contrib/vue
However, the packages don't seem to be playing nice with each other, seemingly they can't see eachother, so I get many, many errors when I try to run the project such as
ERROR in /Users/abarratt/dev/main/src/PODFather-Main/symfather/node_modules/#fullcalendar/common/main.d.ts(96,36):
96:36 Cannot find module './util/scrollbar-width' or its corresponding type declarations.
94 | export { CssDimValue, ScrollerLike, SectionConfig, ColProps, ChunkConfig, hasShrinkWidth, renderMicroColGroup, getScrollGridClassNames, getSectionClassNames, getSectionHasLiquidHeight, getAllowYScrolling, renderChunkContent, computeShrinkWidth, ChunkContentCallbackArgs, sanitizeShrinkWidth, ChunkConfigRowContent, ChunkConfigContent, isColPropsEqual, renderScrollShim, getStickyFooterScrollbar, getStickyHeaderDates, } from './scrollgrid/util';
95 | export { Scroller, ScrollerProps, OverflowValue } from './scrollgrid/Scroller';
> 96 | export { getScrollbarWidths } from './util/scrollbar-width';
| ^
97 | export { RefMap } from './util/RefMap';
98 | export { getIsRtlScrollbarOnLeft } from './util/scrollbar-side';
99 | export { NowTimer } from './NowTimer';
I'm assuming there's some yarn workspaces vs npm battle going on here but perhaps it's just something simple I need to tweak, or some step I've neglected.
Any help would be much appreciated :)
The answer it would seem, is yalc. By building using yarn run build as well as yarn run build-contrib followed finally with a manual yarn run ci inside the vue package (because something seems to break in the build-contrib script so it doesn't get fired properly), I was then able to publish and sym-link these correctly into my npm project properly, with all workspace linking resolved.
I've written the following bash script to do the job for me:
yalc-init-local-fullcalendar-link.sh
#!/bin/sh
if ! command -v yalc &> /dev/null; then
echo ""
echo "Hi,"
echo ""
echo "You must install yalc globally to link the local full calendar packages."
echo "You can do that by running"
echo "sudo npm install yalc -g"
echo ""
echo "Andy Barratt"
echo ""
exit
fi
START_DIR=`pwd`
if [[ -z "$FULLCALENDAR_DIR" ]]; then
FULLCALENDAR_DIR="$HOME/dev/fullcalendar"
fi
yalc_publish_packages_in_folder()
{
cd $#
for package in */ ; do
cd $package
echo "Publishing `pwd`"
yalc publish
cd ..
done
}
# Do some cleanup first
git checkout package.json
rm -rf .yalc
rm yalc.lock
rm -rf node_modules
npm ci
# Build full calendar
cd $FULLCALENDAR_DIR
yarn run build
yarn run contrib:build
# seems one of the other contributing packages has a bug in it,
# so we'll go ahead and run the vue one manually for now.
cd $FULLCALENDAR_DIR/packages-contrib/vue
yarn run ci
yalc_publish_packages_in_folder $FULLCALENDAR_DIR/packages
yalc_publish_packages_in_folder $FULLCALENDAR_DIR/packages-contrib
yalc_publish_packages_in_folder $FULLCALENDAR_DIR/packages-premium
cd $START_DIR
for package in node_modules/#fullcalendar/*/ ; do
package_name=#fullcalendar/`basename $package`
echo Linking $package_name
yalc link $package_name
done
Based on this article, I am trying to generate a repo that runs everytime y push, but also every 4 or 8 hours. as seen by the action history, only one of them was successful, and only on a Mac Machine:
But my goal is to run it on at ubuntu-latest, windows-latest and macos-latest to check the code in all OS. One final goal is to make it so that the message of the scheduled pushs is updated in xxx date. This is my latest code EDITED on sept 23 which can be seen in this repo:
name: render readme
on:
push:
paths:
- README.Rmd
schedule:
- cron: 0 */4 * * *
jobs:
render:
runs-on: macOS-latest
steps:
- uses: actions/checkout#v2
- uses: r-lib/actions/setup-r#v1
- uses: r-lib/actions/setup-pandoc#v1
- name: "[Custom block] [macOS] Install spatial libraries"
if: runner.os == 'macOS'
run: |
# conflicts with gfortran from r-lib/actions when linking gcc
rm '/usr/local/bin/gfortran'
brew install pkg-config gdal proj geos
- name: "[Stage] [macOS] Install libgit2"
if: runner.os == 'macOS'
run: brew install libgit2
- name: Install packages
run: Rscript -e 'install.packages(c("rmarkdown", "pacman", "rgeos"))'
- name: install rgdal
run: Rscript -e 'install.packages("rgdal", configure.args = c("--with-proj-lib=/usr/local/lib/", "--with-proj-include=/usr/local/include/"))'
- name: Render README
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")'
- name: Commit results
run: |
git add README.md man/figures/README-*
git commit README.md -am 'Re-build README.md' || echo "No changes to commit"
git push origin main || echo "No changes to commit"
Now it runs and it actually gives me a tick, but the md is not updated, within the runs in the task called commit results we can see the following error
Run git add README.md man/figures/README-*
git add README.md man/figures/README-*
git commit README.md -am 'Re-build README.md' || echo "No changes to commit"
git push origin main || echo "No changes to commit"
shell: /bin/bash -e {0}
env:
R_LIBS_USER: /Users/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
fatal: paths 'README.md ...' with -a does not make sense
No changes to commit
Everything up-to-date
So the commit or push is not working, thank you #krzysztof-madej, you catched one mistake which was the branch name, but I still can make the results update the README, even though it runs smoothly
Your issue seems to be with git, not github actions. The -a arg will stage all files, so adding README.md seems to make the command invalid. Try changing:
git commit README.md -am 'Re-build README.md' || echo "No changes to commit"
to
git commit -am 'Re-build README.md' || echo "No changes to commit"
Objective: To run it on at ubuntu-latest, windows-latest and macos-latest to check the code in all OS:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
I have a simple dotnet core 2.0 project with a simple issue which is failing SonarLint with an unused variable issue.
The code is stored in a public github repository (here). A travis job (here) runs and has the SonarQube plugin and should post to SonarCloud (here).
The problem I have is that this issue is not being picked up by the analysis and published as an issue. I obviously have something set up incorrectly but I dont know what.
My .travis.yml is below
language: csharp
dist: xenial
sudo: required
mono: none
dotnet: 2.0.0
solution: Dibware.Salon.sln
addons:
sonarcloud:
organization: "dibley1973-github" # the key of the org you chose at step #3
token:
secure: $SONAR_TOKEN
branches:
only:
- master
before_script:
- chmod +x build.sh
- chmod +x run-tests.sh
script:
- ./build.sh
- ./run-tests.sh
- sonar-scanner
My sonar-project.properties file is below
# Project identification
sonar.projectKey=Core:Dibware.Salon
sonar.projectVersion=1.0.0.0
sonar.projectName=Dibware.Salon
# Info required for SonarQube
sonar.sources=./Domain
sonar.language=cs
sonar.sourceEncoding=UTF-8
C# Settings
sonar.dotnet.visualstudio.solution=Dibware.Salon.sln
# MSBuild
sonar.dotnet.buildConfiguration=Release
sonar.dotnet.buildPlatform=Any CPU
# StyleCop
sonar.stylecop.mode=
# SCM
sonar.scm.enabled=false
In the travis log I do have:
INFO: 27 files to be analyzed
WARN: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
INFO: 0/27 files analyzed
WARN: Missing blame information for the following files:
WARN: *
.
<lots of files>
.
WARN: This may lead to missing/broken features in SonarQube
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 216ms, dir size=381 KB
INFO: Analysis report compressed in 56ms, zip size=89 KB
INFO: Analysis report uploaded in 340ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=Core%3ADibware.Salon
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AWo0YQeAUanQDuOXxh79
INFO: Analysis total time: 11.484 s
Is this what is affecting the analysis? If so how do I resolve it? If not what else is stopping the analysis of the files, please?
EDIT:
I can see the following in the log, but it still does not get picked up by SoanrQube..
Chair.cs(17,17): warning CS0219: The variable 'a' is assigned but its value is never used
Edit 2:
I managed to getthe analzed number to go up, see below...
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=6ms
INFO: SCM provider for this project is: git
INFO: 27 files to be analyzed
INFO: 27/27 files analyzed
INFO: Calculating CPD for 0 files
... using the following in my .travis.yml
install:
- git fetch --unshallow --tags
That came from here:
https://stackoverflow.com/a/47441734/254215
Ok, I am not out of the wood yet, but am getting some analysis using the following .travis.yml
language: csharp
dist: xenial
sudo: required
mono: none
dotnet: 2.1.300
solution: Dibware.Salon.sln
addons:
sonarcloud:
organization: "dibley1973-github" # the key of the org you chose at step #3
token:
secure: $SONAR_TOKEN
branches:
only:
- master
install:
- dotnet tool install --global dotnet-sonarscanner
- git fetch --unshallow --tags
before_script:
- export PATH="$PATH:$HOME/.dotnet/tools"
- chmod +x build.sh
- chmod +x run-tests.sh
script:
- dotnet sonarscanner begin /k:"Core:Dibware.Salon" /d:sonar.login="$SONAR_TOKEN" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*" /d:sonar.cs.opencover.reportsPaths="lcov.opencover.xml" || true
- ./build.sh
- ./run-tests.sh
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN" || true
In the end the travis.yml file I used which worked is this:
language: csharp
dist: xenial
sudo: required
mono: none
dotnet: 2.1.300
solution: Dibware.Salon.sln
addons:
sonarcloud:
organization: "dibley1973-github" # the key of the org you chose at step #3
token:
secure: $SONAR_TOKEN
branches:
only:
- master
install:
- dotnet tool install --global dotnet-sonarscanner
- git fetch --unshallow --tags
before_script:
- export PATH="$PATH:$HOME/.dotnet/tools"
- chmod +x build.sh
- chmod +x run-tests.sh
script:
- dotnet sonarscanner begin /k:"Core:Dibware.Salon" /d:sonar.login="$SONAR_TOKEN" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*,**/Dibware.Salon.Web/**/*" || true
- ./build.sh
- ./run-tests.sh
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN" || true
The build file is this.
#!/usr/bin/env bash
dotnet restore
dotnet clean -c Release
dotnet build Dibware.Salon.sln -c Release
The test is this.
# Run the tests and collate code coverage results
dotnet test -c Release --no-build --no-restore Domain/SharedKernel/Dibware.Salon.Domain.SharedKernel.UnitTests/Dibware.Salon.Domain.SharedKernel.UnitTests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
I did not use a sonar-project.properties file.
HTH someone, one day
here is my scenario
our team develops on AIX
dozens of applications, mostly Perl, shell scripts, batch java, C
i would like to simplify deployment/rollback procedures - currently using plain old tarballs with backups
I looked into installp vs. rpm for packaging (see my SO question) and decided to go with rpm - better docs, plus IBM included it while having their own packaging tool, so this is a valid reason for me
i would want to use a separate rpm db, not the main one - for I don't have root access and I also feel it would be beneficial to separate OS apps from our stuff.
the workflow would look like:
each app has a corresponding rpm.spec - checked-in into source control
build an rpm in a home dir
install/upgrade while using our own packages.rpm
NOTE : I will use this question as notes to myself as I proceed
building rpm's in my home :
1.
I need a .rpmmacros file in my user's root which overrides some system-wide rpm settings
%_signature gpg
%_gpg_name {yourname}
%_gpg_path ~/.gnupg
%distribution AIX 5.3
%vendor {Northwind? :)}
%make make
2.
this will create directory structure needed for rpm builds, it will also update .rpmmacros
#!/bin/sh
[ "x$1" = "x-d" ] && {
DEBUG="y"
export DEBUG
shift 1
}
IAM=`id -un`
PASSWDDIR=`grep ^$IAM: /etc/passwd | awk -F":" '{print $6}'`
HOMEDIR=${HOME:=$PASSWDDIR}
[ ! -d $HOMEDIR ] && {
echo "ERROR: Home directory for user $IAM not found in /etc/passwd."
exit 1
}
RHDIR="$HOMEDIR/rpmbuild"
RPMMACROS="$HOMEDIR/.rpmmacros"
touch $RPMMACROS
TOPDIR="%_topdir"
ISTOP=`grep -c ^$TOPDIR $RPMMACROS`
[ $ISTOP -lt 1 ] && {
echo "%_topdir $HOMEDIR/rpmbuild" >> $RPMMACROS
}
TMPPATH="%_tmppath"
ISTMP=`grep -c ^$TMPPATH $RPMMACROS`
[ $ISTMP -lt 1 ] && {
echo "%_tmppath $HOMEDIR/rpmbuild/tmp" >> $RPMMACROS
}
[ "x$DEBUG" != "x" ] && {
echo "$IAM $HOMEDIR $RPMMACROS"
echo "$RHDIR $TOPDIR $ISTOP"
}
[ ! -d $RHDIR ] && mkdir -p $RHDIR
cd $RHDIR
for i in RPMS SOURCES SPECS SRPMS BUILD tmp ; do
[ ! -d ./$i ] && mkdir ./$i
done
exit 0
you could check if rpm picked up your changes with :
rpm --showrc | grep topdir
3.
specify a non-default location of the RPM database, such as the following:
rpm --dbpath /location/of/your/rpm/database --initdb
I usually check in my spec files to the same place that my code is.
I run a build server (I use Hudson) to kick off a build every night (could be continuous but I chose nightly). The build server checks out the code, builds it, and runs rpmbuild. Hudson sets up a workspace folder that can be deleted after each build so if you set %_topdir to point to that area then you can guarantee there won't be build artifacts left over from a previous build. At the end of the build I check my rpms into version control with a comment containing the build number.
Rolling back is a matter of pulling out the last good rpm from version control, erasing the current rpm, and installing the old rpm.
Sounds like you already have a good handle on using your own package db.