GithubHelp home page GithubHelp logo

Support for "build metadata"? about jitsu HOT 4 OPEN

Martii avatar Martii commented on June 3, 2024
Support for "build metadata"?

from jitsu.

Comments (4)

3rd-Eden avatar 3rd-Eden commented on June 3, 2024

So instead of adding a - (dash) when bump your package.json version we used a + (plus sign)

from jitsu.

Martii avatar Martii commented on June 3, 2024

REEDITED FOR CLARITY:
Not quite. Nodejitsu/jitsu still does that dash (-) numerical bump for backward compatibility... but we'd eventually like to send the commit hash (7 digit or full sha1sum) along with it to the nodejitsu backend with our project... then nodejitsu does whatever with it... e.g. perhaps append a custom name/value pairing to a nodejitsu specific portion of the package.json e.g. pass some names/values through... or even setting a custom environment variable... or just flat passing it through along with the dash bump that happens (0.0.0+sha1.12abc67 becomes 0.0.0-1+sha1.12abc67) ... so we can read one of these in programmatically. Then the issue with the -r could be resolved too since the backend has been ignoring that now from an issue I have with support.


Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.

The bolded section is just about exactly what we are looking for from the semver docs... but the backend of jitsu e.g. nodejitsu would need to do something useful with it and jitsu would pass it through with -r or some other new switch.


Here's one of the possible examples to think about:

Sample project package.json that we do:

{
  "name": "Project",
  "description": "Projection description",
  "version": "0.0.0",
  "main": "index",
  "licenses": [
    {
      "type": "GPL-3.0+",
      "url": "http://www.gnu.org/copyleft/gpl.html"
    }
  ],
  "subdomain": "somedomain",
  "domains": [
    "somedomain.org"
  ],
  "scripts": {
    "start": "node index.js"
  },
  "engines": {
    "node": ">=0.10.33"
  }
}

We do a shell script along with a fictitious switch as of right now of:

#!/bin/bash

# Pretend this next line returns `12abc67`
HEAD=`git rev-parse --short HEAD`

# This next line would return `0.0.0`
VER=`node -p 'JSON.parse(process.argv[1]).version' "$(cat package.json)"` 

# The `-r` switch could validate numeric.numeric.numeric
# The `-b` switch could validate ASCII alphanumerics and hyphen [0-9A-Za-z-],
#    with the period `.` which can optionally mean whatever in the backend of Nodejitsu
jitsu deploy -c -r $VER -b $HEAD

Nodejitsu creates the snapshot with this package.json:

{
  "name": "Project",
  "description": "Projection description",
  "version": "0.0.0-1+12abc67",
  "main": "index",
  "licenses": [
    {
      "type": "GPL-3.0+",
      "url": "http://www.gnu.org/copyleft/gpl.html"
    }
  ],
  "subdomain": "somedomain",
  "domains": [
    "somedomain.org"
  ],
  "scripts": {
    "start": "node index.js"
  },
  "engines": {
    "node": ">=0.10.33"
  }
}

All of this could keep semver happy, nodejitsu and quite possibly more than just one customer too.

from jitsu.

Martii avatar Martii commented on June 3, 2024

Do my huge, multiple, revisions above make more sense?

from jitsu.

Martii avatar Martii commented on June 3, 2024

bump

Any progress of restoring the build metadata (e.g. everything including and after the + symbol) to the a projects package.json with $ jitsu deploy ?? TIA

from jitsu.

Related Issues (20)

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.