TeamCity 7.x collect commit messages during build - release notes - mercurial

Our TeamCity builds a complete installer package that includes several web applications, console applications and win forms applications. It constitutes an application suite. Each of these applications has it's own Mercurial repository.
What we'd like to be able to do is automatically supply release notes for each version. TeamCity already displays Mercurial commit messages in web interface when one hovers over changes for a build. Is it possible to somehow capture those messages during a build and extract them to a text file in agent work folder?

I don't know TeamCity, but I have a simple method of taking the commits of a bit of software and formatting it into a neat history log, which I guess is what you're after. Perhaps you can take this and modify it to suit your needs - it uses only mercurial commands, so you could add it as a dependency of your build (I have a post-build step of my VC++ project which runs the command and outputs to a text file).
I have a simple template like so:
$ cat history.template
changeset = '{tags} {rev}\t{desc|fill68|strip|tabindent}\n'
start_tags = '\n'
tag = '{tag},'
last_tag = '{tag} : {node|short} # {date|shortdate}\n'
And when I use the following hg command to create a usable history log:
hg log --style history.template -r "reverse(::.) & !desc('Added tag')"
The command takes commit comments of all ancestors of the working directory, outputting a tag and changeset hash, along with the date the tag was created, and then all associated changes. Here's an example hg log -G output of a test repo, showing the default and release branches:
# 21[tip]:18 c676cfe95284 2012-12-12 10:12 +0000 rob
| Added tag 0.0.5 for changeset d0869f1c84ba
|
| o 20 7618cafcfc5d 2012-11-26 17:23 +0000 rob
| | More changes indeed
| |
| o 19:17 ffc8bef85a2e 2012-11-26 17:22 +0000 rob
| | Some additional files were needed
| |
o | 18[0.0.5]:15,17 d0869f1c84ba 2012-11-22 17:25 +0000 rob
|\| Releasing
| |
| o 17 a41d817184ea 2012-11-22 17:25 +0000 rob
| | Made the last change
| |
| o 16:13 e790e9022e70 2012-11-22 17:24 +0000 rob
| | Made some changes using "record"
| |
o | 15 15f21a6f554a 2012-11-13 17:03 +0000 rob
| | Added tag 0.0.4 for changeset c316b232c95c
| |
o | 14[0.0.4]:10,13 c316b232c95c 2012-11-13 17:03 +0000 rob
|\| Merging, eh?
| |
| o 13 ba00c7045a23 2012-11-13 17:02 +0000 rob
| | Modified revset selection for logging
...
The template and command shown outputs the following:
0.0.5 : d0869f1c84ba # 2012-11-22
18 Releasing
17 Made the last change
16 Made some changes using "record"
0.0.4 : c316b232c95c # 2012-11-13
14 Merging, eh?
13 Modified revset selection for logging
12 When logging history select only ancestors of the working directory
11 Added history logging
...
Add a comment if you would like some explanation of the command-line or template.

Related

Azure DevOps SSRS Server Report Deployment

I've seen lots of questions about deploying SSRS reports via an Azure Pipeline, but I haven't found one that seems to address this.
When connecting to an SSRS instance via a Powershell task running the code
New-RsWebServiceProxy
We get Failed to establish proxy connection to Server Address : The term 'New-WebServiceProxy' is not recognized as a name of a cmdlet, function, script file, or executable program.
This is after registering ReportingServicesTools from the gallery
- task: PowerShell#2
inputs:
targetType: 'inline'
script: |
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
Install-Module -Name ReportingServicesTools
Import-Module ReportingServicesTools -UseWindowsPowerShell
PowerShell Version on the Agent;
| Name | Value |
|---------------------|------------------|
|PSVersion | 7.2.8|
|PSEdition | Core|
|GitCommitId | 7.2.8|
|OS | Linux 5.15.0-1030-azure #37-Ubuntu SMP Mon Dec …|
|Platform | Unix|
|PSCompatibleVersions | {1.0, 2.0, 3.0, 4.0…}|
|PSRemotingProtocolVersion | 2.3|
|SerializationVersion | 1.1.0.1|
|WSManStackVersion | 3.0|
The Repository seems to suggest that it won't be supported going foward.
https://github.com/microsoft/ReportingServicesTools/issues/239#issuecomment-595115438
Anyone know how to fix this?
Thanks,
Dan

hg / mercurial: how to get all commits which goes to new app release?

I'm using hg flow (similar to git flow) approach.
I need all commits between my current branch "release/2.0.0" latest commit and previous "develop" commit in point there "release/1.0.0" was started.
In short words: I want all commits which will go in new release candidate package.
Please take a look at screenshot.
I want all commits which are inside red line. They are all changes since previous app release.
This is actually very easy with mercurial: revsets to the rescue!
You basically want to include everything which happend prior to your current dev release, but exclude that stuff which happend already prior to the last release:
hg log -r"ancestors(DEVREV) and not ancestors(RELEASE)"
where DEVREV is the revision of your current one and RELEASE the revision of the last release.
E.g.:
ingo#aeolus:~/hg-test$ hg log -G -T"{rev}: {desc}\n"
# 8: New release
|
| o 7: New dev stuff
| |
o | 6: Merge 4
|\ \
| | o 5: Add cc
| |/
| o 4: Add bb
| |
o | 3: Add d
| |
o | 2: Add c
| |
o | 1: Add b
|/
o 0: Add a
ingo#aeolus:~/hg-test$ hg log -r"ancestors(7) and not ancestors(8)"
changeset: 5:ce0558751c5a
user: planetmaker <planetmaker#openttd.org>
date: Wed Aug 22 16:14:12 2018 +0200
summary: Add cc
changeset: 7:78f338d1c8fa
parent: 5:ce0558751c5a
user: planetmaker <planetmaker#openttd.org>
date: Tue Oct 09 13:02:20 2018 +0200
summary: New dev stuff
You might want to try --style=changelog with the appropriate revset though.

Drupal 8 translatable configuration

I'm trying to setup a custom module that provide content from an API.The API url is configurable, but as it is different for each language I must be able to translate it. I setup my module configuration as described here (see the gist below) but when I try to access the translation form from /admin/config/regional/config-translation, i get "Access denied"
What am I doing wrong ?
https://gist.github.com/julien-maitan/ffd136bc104d3dbe2ee526367ffcb44c
First of all,
Does your custom permission configure crtib configurator is defined in a permissions.yml file ? And did you give this permission to your user ?
Where is your config/install settings file ? In your case your crtib_configurator.settings.yml ? Did you miss it ?
These files are not mandatory by default in Drupal 8, but are required once we want to make your configuration translatable.
I would suggest you this 2 articles:
Drupal 8 - How to translate the Config API
Drupal 8 multilingual tidbits 16: configuration translation development
Update - With Review of Google Drive Files
config folder should be placed in the root of your module not in src;
crtib_configurator.links.task.yml use a wrong route_name crtib_configurator.api_settings_translate, it should be crtib_configurator.api_settings.
Apply those 2 changes & clear your cache, you will then be able to use the translations form properly.
I think the main & initial error was the config folder location.
Directory structure:
.
+-- crtib_configurator
| +-- config
| | +-- install
| | | +-- crtib_configurator.api.yml
| | +-- schema
| | | +-- crtib_configurator.schema.yml
| +-- src
| | +-- Form
| | | +-- SettingsForm.php
| +-- crtib_configurator.config_translation.yml
| +-- crtib_configurator.info.yml
| +-- crtib_configurator.links.menu.yml
| +-- crtib_configurator.links.task.yml
| +-- crtib_configurator.permissions.yml
| +-- crtib_configurator.routing.yml
Content of crtib_configurator.links.task.yml:
crtib_configurator.api_settings:
route_name: crtib_configurator.api_settings
title: 'CRTIB configurator settings'
base_route: crtib_configurator.api_settings

Fiware cloud new instances, statuses and connection

How to create FiWare instance and connect it to internet?
I like the idea and I have big plans on using this infrastructure, but...
I've trying to create instance and make ssh connection to it for some time now.
Created key-pair
Created security group (22,3306,1)
Created instance ubuntu 14 (also tried others)
Also tried ubuntu 12, POI and others already
Added node-int-net-01 and node-int-noinet-net-02 to it when creating
Also tried already with 1 network only
Allocated floating IP
Associated it with the local IP that came from "node-int-net-01"
Statuses:
Instance: ACTIVE, Power State RUNNING
"node-int-net-01" networks in list: shared-subnet 192.168.192.0/18 Yes ACTIVE UP
Inside "node-int-net-01":
Network: Admin State: DOWN, Shared: No, External Network: No
Subnet: DHCP and all ok
Ports: Status: BUILD, Admin State: UP
The confusing parts are (for clue, don't have to answer those if we have solution):
How can network be EXTERNAL-SHARED-ACTIVE-UP and DOWN-NOT_SHARED-NO_EXTERNAL at the same time - perhaps there's an error
What means Port status: BUILD, i mean it must have been building the port like 3 days already. Should i build there something, is it an order or status? Perhaps it means BUILT or BUILDING instead.
What means instance ACTIVE? Is it still active (busy) and i should wait? Or it can be actively used already? From VM Display I never saw it going to unix prompt>, is it kind of fiware itself using this telnet instance? I rather saw things like
"request error",
"connection timeout",
"socket.error",
"Error 101 Network is unreachable".
"cloud-init-nonet [13:31]: waiting 120 seconds for network device"
numerous black-screens and never ending Booting from hard-disk
from Instance log saw endless: "Waiting for network configuration", but that one was cured
Thou i saw "localhost login prompt, but as i only created PEM, then
cant imagine what to do with it - where do i get root/pwd? But i guess it was some error that it ended up there.
The latest status from Instance\Log is:
cloud-init-nonet[4.52]: static networking is now up
* Starting configure network device[74G[ OK ]
* Starting Mount network filesystems[74G[ OK ]
* Stopping Mount network filesystems[74G[ OK ]
* Stopping cold plug devices[74G[ OK ]
* Stopping log initial device creation[74G[ OK ]
* Starting enable remaining boot-time encrypted block devices[74G[ OK ]
Cloud-init v. 0.7.5 running 'init' at Sat, 16 Apr 2016 01:23:11 +0000. Up 5.07 seconds.
ci-info: ++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++
ci-info: +--------+------+-----------------+---------------+-------------------+
ci-info: | Device | Up | Address | Mask | Hw-Address |
ci-info: +--------+------+-----------------+---------------+-------------------+
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . |
ci-info: | eth0 | True | 192.168.242.127 | 255.255.192.0 | fa:16:3e:7a:47:94 |
ci-info: +--------+------+-----------------+---------------+-------------------+
ci-info: +++++++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++++++
ci-info: +-------+---------------+---------------+---------------+-----------+-------+
ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
ci-info: +-------+---------------+---------------+---------------+-----------+-------+
ci-info: | 0 | 0.0.0.0 | 192.168.192.1 | 0.0.0.0 | eth0 | UG |
ci-info: | 1 | 192.168.192.0 | 0.0.0.0 | 255.255.192.0 | eth0 | U |
ci-info: +-------+---------------+---------------+---------------+-----------+-------+
For a ping and ssh i get: "Destination Host Unreachable" and "No route to host"
Also tried allocating floating IP with "federation" pool, but with that IP i just got time-outs for ping and ssh
I read already:
wiki
fiware help
stackoverflow
Followed also the steps in this slideshow http://www.slideshare.net/fermingalan/developing-your-first-application-using-fi-ware-20130903
http://cosmos.lab.fi-ware.org/cosmos-gui/ seems to be down
EDIT: can use this one (need to use https and accept bad cert)
http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE.OpenSpecification.Data.BigData_R4#Basic_concepts
http://catalogue.fiware.org/enablers/bigdata-analysis-cosmos/documentation - no info about it neither.
Any ideas? Perhaps there is an UI (other than the web page at https://cloud.lab.fiware.org/ that seems to be in early beta) for using FiWare (that can do all the "anyway-mandatory" steps for users (developers)?
Maybe the problem is that I'm a software developer not network administrator, and perhaps this interface is meant for linux network andministrators.
The message "Error 101 Network is unreachable" shows that there was a problem in the VM network. node-int-net-01 is the shared network to be joined with the public network, while node-int-noinet-net-02 is to be joined with a network to use VPN. You shouldn't use both networks in the same VM, just you should use node-int-net-01.
The code messages like BUILD, ACTIVE and so on, are codes belonging to Openstack.
Regarding ping, you should open the icmp port in the security port to allow it.
Anyway, if you continue having problems, you can send a mail to FIWARE Lab support fiware-lab-help#lists.fiware.org, indicating your concrete data.

Mercurial: annotate / blame current line number

hg annotate -unl aFile
Shows:
jim 1519:477: a = 4
bob 1518:468: b = 5
joe 1496:402: return a
How do I get it to show
jim 401: a = 4
bob 402: b = 5
joe 403: return a
Where 401, 402, 403 are the current line numbers. Better yet would be something like git has with git blame -L 401,403 aFile.
To show current line numbers:
hg annotate -u aFile | cat -n
To also select only a certain range of line numbers:
hg annotate -u aFile | cat -n | sed -n 401,403p
I always use the annotate view in hg serve or from TortoiseHg. I find the command line annotate pretty poor since I cannot quickly jump to a parent revision. The hgweb annotate can be seen here:
https://www.mercurial-scm.org/repo/hg/annotate/tip/README
It includes (current) line numbers.