Jump to content

User:TCipriani (WMF)/Gerrit/Tutorial/Materialize

From mediawiki.org

🧑🏽‍💻 Gerrit for Product Analytics–Tutorial


Materialize Changes

Now you can make changes to your repo. Here we'll follow along with the Creating a new schema tutorial from Wikitech.

# 1️⃣ Step 1

Change to your newly cloned schemas/event/secondary directory and run npm i to install all the software needed to make a new schema.

❇️ npm i

Now you'll have a node_modules directory inside the schemas/event/secondary directory.

schemas/event/secondary/node_modules
├── acorn
├── acorn-jsx
├── ajv
├── ansi-colors
├── ansi-escapes
├── ansi-regex
├── ansi-styles
├── argparse
├── args
├── astral-regex
├── atomic-sleep
├── @babel
├── balanced-match
├── bluebird
├── brace-expansion
├── browser-stdout
├── call-me-maybe
├── callsites
├── camelcase
├── chalk
├── chardet
├── cli-cursor
├── cliui
├── cli-width
├── color-convert
├── color-name
├── compute-gcd
├── compute-lcm
├── concat-map
├── cross-spawn
├── dateformat
├── debug
├── decamelize
├── deep-is
├── define-properties
├── diff
├── doctrine
├── drange
├── emoji-regex
├── end-of-stream
├── es-abstract
├── escape-string-regexp
├── eslint
├── eslint-scope
├── eslint-utils
├── eslint-visitor-keys
├── espree
├── esprima
├── esquery
├── esrecurse
├── es-to-primitive
├── estraverse
├── esutils
├── external-editor
├── fast-deep-equal
├── fast-json-stable-stringify
├── fast-levenshtein
├── fast-redact
├── fast-safe-stringify
├── figures
├── file-entry-cache
├── find-up
├── flat
├── flat-cache
├── flatstr
├── flatted
├── format-util
├── fs-extra
├── fs.realpath
├── functional-red-black-tree
├── function-bind
├── get-caller-file
├── glob
├── globals
├── glob-parent
├── graceful-fs
├── growl
├── @hapi
├── has
├── has-flag
├── has-symbols
├── he
├── hosted-git-info
├── iconv-lite
├── ignore
├── import-fresh
├── imurmurhash
├── inflight
├── inherits
├── inquirer
├── is-buffer
├── is-callable
├── is-date-object
├── isexe
├── is-extglob
├── is-fullwidth-code-point
├── is-glob
├── is-regex
├── is-symbol
├── jmespath
├── joycon
├── jsonfile
├── jsonpath-plus
├── json-schema-compare
├── json-schema-faker
├── json-schema-merge-allof
├── json-schema-ref-parser
├── json-schema-traverse
├── json-stable-stringify-without-jsonify
├── js-tokens
├── js-yaml
├── leven
├── levn
├── locate-path
├── lodash
├── log-symbols
├── lru-cache
├── mimic-fn
├── minimatch
├── minimist
├── mkdirp
├── mocha
├── mri
├── ms
├── mute-stream
├── natural-compare
├── netmask
├── nice-try
├── node-environment-flags
├── node-fetch
├── object.assign
├── object.getownpropertydescriptors
├── object-inspect
├── object-keys
├── once
├── onetime
├── ono
├── optionator
├── os-tmpdir
├── parent-module
├── path-exists
├── path-is-absolute
├── path-key
├── pino
├── pino-pretty
├── pino-std-serializers
├── p-limit
├── p-locate
├── prelude-ls
├── progress
├── p-try
├── pump
├── punycode
├── quick-format-unescaped
├── randexp
├── readable-stream
├── recursive-readdir-sync
├── regexpp
├── require-directory
├── require-main-filename
├── resolve-from
├── restore-cursor
├── ret
├── rewire
├── rimraf
├── run-async
├── rxjs
├── safe-buffer
├── safer-buffer
├── semver
├── set-blocking
├── shebang-command
├── shebang-regex
├── signal-exit
├── slice-ansi
├── sonic-boom
├── split2
├── sprintf-js
├── string_decoder
├── string.prototype.trimend
├── string.prototype.trimleft
├── string.prototype.trimright
├── string.prototype.trimstart
├── string-width
├── strip-ansi
├── strip-json-comments
├── supports-color
├── table
├── text-table
├── through
├── tmp
├── tslib
├── type-check
├── type-fest
├── universalify
├── uri-js
├── util-deprecate
├── v8-compile-cache
├── validate.io-array
├── validate.io-function
├── validate.io-integer
├── validate.io-integer-array
├── validate.io-number
├── which
├── which-module
├── wide-align
├── @wikimedia
├── word-wrap
├── wrap-ansi
├── wrappy
├── write
├── y18n
├── yallist
├── yargs
├── yargs-parser
└── yargs-unparser

216 directories, 0 files

# 2️⃣ Step 2

Make a new directory for your schema lineage:

Create a new schema

And then add a current.yaml file in the directory jsonschema/mediawiki/desktop/button/click with your schema.

# 3️⃣ Step 3

Commit your change using git commit.

Below I run three commands:

  • git status – shows what files git knows about and whether those files have changed since git last saw them
  • git add – tells git that you'd like to include these files in your next commit
  • git commit – tells git that you're done working on the file. Adding -m "some message" will add a commit message to the code. Commit messages should use present tense (e.g., "Add" instead of "Added" or "Adding") and be less than 72 characters by convention.
✅ Git commit

You'll notice that a lot of things happened after you typed git commit. Git used a script to create version files for your new schema lineage. You can see them in your directory tree:

jsonschema/mediawiki/desktop/button/click/
├── 1.0.0 -> 1.0.0.yaml
├── 1.0.0.json
├── 1.0.0.yaml
├── current.yaml
├── latest -> 1.0.0.yaml
├── latest.json -> 1.0.0.json
└── latest.yaml -> 1.0.0.yaml