Code Monkey home page Code Monkey logo

scm4j-releaser's People

Contributors

host6 avatar maxim-ge avatar vitkud avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

vitkud snafua

scm4j-releaser's Issues

Exact versions in `develop`/`mdeps`

Normally coordinates in 'develop/mdeps` denotes SHAPSHOT version:

org.scm4j:scm4j-vcs-api:-SNAPSHOT
org.scm4j:scm4j-vcs-test:master-SNAPSHOT

In this case versions are changed when release branch is created:

master-SNAPSHOT -> 4.0
-SNAPSHOT -> 4.0
1.0 -> 4.0

Configuration

CC

  • If env variables SCM4J_CC, SCM4J_VCS_REPOS exists use it
  • $user.home/cc.yml + content of $user.home/cc

CREDENTIALS

  • if env variable SCM4J_CREDENTIALS exists use it
  • $user.home/credentials.yml

INIT

When CLI starts it checks $user.home/.scm4j. If it does not exist CLI puts the following files there

  • cc

  • cc.yml

  • credentials.yml

  • Init wokring folder with config templates

  • VCS-REPOS -> CC

Circular dependency detection

unTill depends on UBL and Db, UBL depends on Db, Db depends on UBL

  • unTill
    • UBL
      • Db
        • UBL
          ...
    • Db
      • UBL
        ....

Deadlock: Db waits for UBL,UBL waits for Db

  • unTill gets its dependencies: UBL and Db
  • UBL and DB are computing simultaneously
    • UBL
      • put UBL-DUMMY into cache (2)
      • compute its dependency: Db
        • Db sees that cache contains Db-DUMMY (1) and waits for it
    • Db
      • put Db-DUMMY into cache (1)
      • compute its dependency: UBL
        • UBL sees that cache contains UBL-DUMMY (2) and waits for it

minor release status

  • CR: current release, develop.version - minor(1)
  • CRB: current release branch
  • RB: release branch

MINOR BUILD STATUS

Status denotes next action which should be undertaken to finish minor build: {FORK, FREEZE, BUILD_MDEPS, ACTUALIZE_PATCHES, BUILD, DONE}

  • If version is not locked: FORK needed? => FORK
  • If version is locked: mdeps extended status is calculated using mdeps from particular RB
  • CRB.version.patch >0 => DONE
  • mdeps are not frozen => FREEZE
  • Any component is not in DONE status => BUILD_MDEPS
  • Any component has patch which is greater than one mentioned in mdeps => ACTUALIZE_PATCHES
  • If none of above : BUILD

FORK NEEDED?

{YES, NO}

  • CRB does not exist => YES
  • CRB.version.patch == 0 => NO
  • Extended status of subcomponents is calculated. if CRB exists and version.patch == 0 mdeps are taken from CRB otherwise from develop
  • develop branch has valuable commits => YES
  • Any mdep needs FORK => YES
  • Versions in mdeps does NOT equal to components CR versions => YES (means that all is built but some sub-component has newer minor or patch)
  • NO

PATCH BUILD STATUS

Status denotes next action which should be undertaken to finish patch build: {ACTUALIZE_PATCHES, BUILD, DONE}

  • RB does not exist or RB.patch < 1 => ERROR, show error on status command
  • mdeps are not frozen => FREEZE
  • Any component is not in DONE status => BUILD_MDEPS
  • Any component has patch which is greater than one mentioned in mdeps => ACTUALIZE_PATCHES
  • No valuable commits after last tag => DONE
  • If none of above : BUILD

EXTENDED STATUS

  • Coords
  • Status
  • latestVersion. If Coords includes version latest version is taken from correspondent RB, otherwise CRB is used
  • Map<Coords, ExtendedStatusTreeNode> subComponents

Build command shoud not avoid FORK-FREEZE

status FORK or FREEZE, command fork => component forked and\or frozen
status FORK or FREEZE, command build => component forked and\or frozen and then built
status > FREEZE, command fork => nothing happens
status > FREEZE, command build => executed whatever need to build

How to detect the patch is built already?

Assume we have release branch relese/2 and 2 patches are released: 2.0 and 2.1. We merged new features into release/2 and now want to chek if 2.1 is built or not. We provided version 2.1 to product coords and we expecting to see 2.1 ACTUAL but we see 2.1 BRANCHED and reliser offers to build it. It builds, but Tag 2.1 can not be created since it is exists already.

Delayed tagging

  • --delayed-tag cli option avoids root component tagging and version bumpings (will be only built)
  • delayed-tags.yml keeps revisions and versions to be tagged. Located in current directory
  • tag command uses delayed-tags.yml to tag last build

Exception is thrown if a component is building with --delayed-tag option and delayed-tags.yml already contains a dealyed tag for this component

delayed-tags.yml file content example

https://com.github.myrepo/myproject
  version: 2.59.0
  revision: df7d6683c77f214a3bcde1481574362491efc28a

Can not build root if nested is fixed by dev branch commit

Case:

  • Fork unTill and unTillDb
  • Build unTill
    • unTillDb is failed to build
  • commit fix to unTillDb master, merge it to release branc
  • Build unTill
    • unTillDb is built
    • unTill is failed to build
  • add fix, merge to unTill release
  • Build unTill
    • exception: trying to build unforked unTillDb (has commits in master)

Checkout conflict with files

Must be automatically handled somehow

`release branch version calculation: com.triniforce.tf-server-toolkit:tf-server-toolkit in 3204ms
status calculation: com.triniforce.tf-server-toolkit:tf-server-toolkit in 922ms
org.scm4j.vcs.api.exceptions.EVCSException: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files: 
src/com/triniforce/soap/ClassParser.java
src/com/triniforce/soap/CustomSerializer.java
src/com/triniforce/soap/InterfaceDescriptionGenerator.java
src/com/triniforce/soap/SOAPServlet.java
src/com/triniforce/soap/TypeDefLibCache.java
test/com/triniforce/soap/ClassDefLibTest.java
test/com/triniforce/soap/ClassParserTest.java
test/com/triniforce/soap/CustomSerializerTest.java
test/com/triniforce/soap/InterfaceDescriptionGeneratorTest.java
test/com/triniforce/soap/ObjectConverterTest.java
test/com/triniforce/soap/SoapHandlerTest.java
test/com/triniforce/soap/TypeDefLibCacheTest.java
test/com/triniforce/soap/WsdlTypeElementTest.java
	at org.scm4j.vcs.GitVCS.fileExists(GitVCS.java:715)
	at org.scm4j.releaser.branch.DevelopBranch.getMDeps(DevelopBranch.java:57)
	at org.scm4j.releaser.SCMReleaser.lambda$getCalculatedResult$4(SCMReleaser.java:107)
	at org.scm4j.releaser.SCMReleaser.reportDuration(SCMReleaser.java:118)
	at org.scm4j.releaser.SCMReleaser.getCalculatedResult(SCMReleaser.java:107)
	at org.scm4j.releaser.SCMReleaser.getActionTree(SCMReleaser.java:52)
	at org.scm4j.releaser.SCMReleaser.getActionTree(SCMReleaser.java:47)
	at org.scm4j.releaser.SCMReleaser.getActionTree(SCMReleaser.java:35)
	at org.scm4j.releaser.SCMReleaser.getActionTree(SCMReleaser.java:31)
	at org.scm4j.releaser.cli.CLI.execInternal(CLI.java:59)
	at org.scm4j.releaser.cli.CLI.exec(CLI.java:76)
	at org.scm4j.releaser.cli.CLI.exec(CLI.java:89)
	at org.scm4j.releaser.cli.CLI$exec.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at CLIRunner.main(releaser.gsh:8)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1446)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:899)
	at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:287)
	at groovy.lang.GroovyShell.run(GroovyShell.java:518)
	at groovy.lang.GroovyShell.run(GroovyShell.java:507)
	at groovy.ui.GroovyMain.processOnce(GroovyMain.java:653)
	at groovy.ui.GroovyMain.run(GroovyMain.java:384)
	at groovy.ui.GroovyMain.process(GroovyMain.java:370)
	at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)
	at groovy.ui.GroovyMain.main(GroovyMain.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with files: 
src/com/triniforce/soap/ClassParser.java
src/com/triniforce/soap/CustomSerializer.java
src/com/triniforce/soap/InterfaceDescriptionGenerator.java
src/com/triniforce/soap/SOAPServlet.java
src/com/triniforce/soap/TypeDefLibCache.java
test/com/triniforce/soap/ClassDefLibTest.java
test/com/triniforce/soap/ClassParserTest.java
test/com/triniforce/soap/CustomSerializerTest.java
test/com/triniforce/soap/InterfaceDescriptionGeneratorTest.java
test/com/triniforce/soap/ObjectConverterTest.java
test/com/triniforce/soap/SoapHandlerTest.java
test/com/triniforce/soap/TypeDefLibCacheTest.java
test/com/triniforce/soap/WsdlTypeElementTest.java
	at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:275)
	at org.scm4j.vcs.GitVCS.checkout(GitVCS.java:387)
	at org.scm4j.vcs.GitVCS.fileExists(GitVCS.java:711)
	... 38 more
Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files: 
src/com/triniforce/soap/ClassParser.java
src/com/triniforce/soap/CustomSerializer.java
src/com/triniforce/soap/InterfaceDescriptionGenerator.java
src/com/triniforce/soap/SOAPServlet.java
src/com/triniforce/soap/TypeDefLibCache.java
test/com/triniforce/soap/ClassDefLibTest.java
test/com/triniforce/soap/ClassParserTest.java
test/com/triniforce/soap/CustomSerializerTest.java
test/com/triniforce/soap/InterfaceDescriptionGeneratorTest.java
test/com/triniforce/soap/ObjectConverterTest.java
test/com/triniforce/soap/SoapHandlerTest.java
test/com/triniforce/soap/TypeDefLibCacheTest.java
test/com/triniforce/soap/WsdlTypeElementTest.java
	at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:448)
	at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:430)
	at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:271)
	... 40 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.