Skip to content

Commit

Permalink
Merge pull request #3 from linode/develop
Browse files Browse the repository at this point in the history
Syncing from master
  • Loading branch information
ztemqnoj authored Feb 14, 2020
2 parents 09a2e1e + d129947 commit e08fce0
Show file tree
Hide file tree
Showing 216 changed files with 7,145 additions and 5,208 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,10 @@ localStorage.json
.scannerwork
.sonar
packages/manager/test-report.xml

# cypress files/folders
**/manager/config/development.json
**/manager/config/staging.json
**/manager/cypress/videos/
**/manager/cypress/screenshots/

4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ before_install: sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev
build-essential g++ google-chrome-stable curl
install:
- yarn install:all
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then audit-ci --low; fi

#before_script:
#- lerna run --stream --scope linode-manager storybook &
script:
- yarn build
- yarn test
#- lerna run --stream --scope linode-manager storybook:e2e
#- 'pkill -f selenium-standalone || :'
#- pkill -f storybook
env:
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,74 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v1.0.0] - 2020-02-10

### Added:
- New One-Click Apps:
- MEAN
- MongoDB
- Flask
- Django
- Redis
- Ruby on Rails
- PostgreSQL

### Changed:
- Change default distro to Debian 10
- Fix changelog to match GitHub release
- Update graph units on Linode Details page
- Fetch backups after selecting Linode in Linode Create
- Toast notifications for Image related events
- Unify graph colors across the app
- LKE: Warn users before allowing a single-node cluster
- LKE: Update typings for node pools
- Show Domains Import Zone Drawer button when a user has no Domains
- Improve compile time
- Cleanup axios version management and aligning
- Prevent unneeded requests when loading Lish window

### Fixed:
- Updating a Linode causes in-progress events to stop being displayed
- Safari: Open ticket button issue
- Remove plural for hour on DNS manager
- 'Show More' tooltip accessibility fix

## [0.84.1] - 2020-02-04

### Fixed:
- Fix issue where only 100 Images were displayed


## [v0.84.0] - 2020-01-28

### Added:
- Add Domain Transfers to Domain Drawer for slave Domains
- “Delete” button to Domain Drawer
- Improve Form context help/info in Configuration Edit
- Ability to delete a Domain from Domain Detail
- Show a banner when one or more Regions experience outages
- New One-Click App: phpMyAdmin
- Show progress on the target Linode while cloning

### Changed:
- Add link to Resizing a Linode Guide
- [LKE] Node pools should have 3 nodes by default
- Longview Process Arrow Rework
- StackScript author links from StackScript Detail page
- Sort Kubernetes versions by label descending in dropdown
- OAuth Scopes can be space separated
- Store Longview time selection in user preferences

### Fixed:
- Longview Overview graphs were incorrectly showing data as “today”
- Refactor LineGraphs to allow mixed units for network graphs
- Routing on Search Landing page for slave Domains
- Fix Linode network graph units
- Display updated credit card info in Billing Summary when credit card is updated
- Visual regression on Clone Configs/Disks
- Loading state for Longview landing page (visual bug)


## [v0.83.0] - 2020-01-17

### Added:
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ In order to contribute to Linode UI, we recommend the following minimum version
2. Node v10.16.0
3. Yarn 1.16.0

You must also have [Lerna](https://lerna.js.org/) installed globally, so please run the following to install the package to your local machine:

```
yarn global add lerna
```

## Development

### Coding Style
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ WORKDIR /home/node/app
RUN chown -R node:node /home/node/app
USER node

RUN yarn global add lerna

# Copy the root level package.json and run yarn if anything changes
COPY --chown=node:node package.json yarn.lock tslint.json ./
RUN yarn

# Copy lerna.json
COPY --chown=node:node lerna.json .
COPY --chown=node:node scripts ./scripts/

# Copy Cloud Manager deps
Expand All @@ -26,7 +22,7 @@ COPY --chown=node:node packages/manager/patches ./packages/manager/patches/
COPY --chown=node:node packages/linode-js-sdk/package.json ./packages/linode-js-sdk/

# Runs "yarn install" for all child packages
RUN npx lerna bootstrap
RUN yarn install:all

# Copy the rest of the files that don't require installation
COPY --chown=node:node packages/linode-js-sdk ./packages/linode-js-sdk/
Expand Down
19 changes: 13 additions & 6 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ This document explains the instructions for setting up Linode UI locally, step-b

## Preface

This repository uses [Lerna](https://lerna.js.org/), a solution to transform JavaScript-based repositories
This repository uses [Yarn Workspaces](https://legacy.yarnpkg.com/lang/en/docs/workspaces/), a solution to transform JavaScript-based repositories
into one, combined monorepo. This is useful because it allows us to maintain multiple different projects in one place, with shared dependencies.

You can assume that as long as you are `cd`ed into the root of this project, any [Lerna commands](https://github.com/lerna/lerna/tree/master/commands) are fair game. Feel free to start any individual package or multiple. but please keep in mind that if you plan on running the Cloud Manager locally, you'll want to start all projects.
There is 3 `package.json` files, 1 for the root, and one for each folder in `packages/`. running `yarn` will install everything, and "hoist" as much as possible in the root `node_modules` folder. There is also 1 unique `yarn.lock` at the root.

Most of the time you will directly use the commands from this documentation. If you have to run a specific command the rule is:
- To run a command in both sub packages `yarn workspace <command>`
- To run a command in 1 subpackage `yarn workspace linode-js-sdk <command>`, or `yarn workspace linode-manager <command>`

Note the workspace names are defined in the root `package.json`
- linode-js-sdk: /packages/linode-js-sdk
- linode-js-sdk: /packages/linode-manager

## Starting All Projects

Expand All @@ -16,7 +24,7 @@ If your intention is to start a development server for all projects, you have a
To start all projects:

While in the root...
1. Run `yarn install:all` to install all dependencies and setup `lerna`
1. Run `yarn install:all` to install all dependencies
2. Run `yarn start:all` to start a development server for all projects

Alternatively, you can run `yarn up` which runs all previous commands.
Expand All @@ -25,8 +33,8 @@ Alternatively, you can run `yarn up` which runs all previous commands.

Starting a single project is similar to the previous instructions with the exception of adding a `--scope` flag to to the command. So for example, starting the Cloud Manager project looks like:

1. Run `yarn install:all` to install all dependencies and setup `lerna`
2. Run `npx lerna run start --scope linode-js-sdk` to start a development server for the JavaScript SDK
1. Run `yarn install:all` to install all dependencies
2. Run `yarn workspace linode-js-sdk start` to start a development server for the JavaScript SDK
* `linode-js-sdk` is the name located in `packages/linode-js-sdk/package.json`

### To do the same thing with Yarn
Expand All @@ -43,7 +51,6 @@ See [this document](./TESTING.md)
## Helper Scripts

* `yarn clean` is an alias that will remove both top-level and package-level `node_modules`.
* Please note - this also bypasses the confirmation Lerna gives by default to delete package-level `node_modules`
* `yarn test` is an alias that will run a test suite in the Cloud Manager project
* `yarn test packages/manager/src/App.test.tsx` for example

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<p align="center">
<a href="https://travis-ci.org/linode/manager"><img src="https://travis-ci.org/linode/manager.svg?branch=master" alt="Build status" /></a>
<a href="https://coveralls.io/github/linode/manager?branch=master"><img src="https://coveralls.io/repos/github/linode/manager/badge.svg?branch=master" alt="Code coverage" /></a>
<a href="https://lerna.js.org/" alt="maintained with lerna"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg" /></a>
</p>

This repository is the home for all things related to front-end development at Linode.
Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ When you plan on releasing a new version of Cloud Manager:
8. At this point, run the end-to-end test suite. Please see a team member on instructions how to do so.
9. When you're ready to make the merge to master AKA release to production, you need to do 2 things: Add the git tag, and ensure the changelog has the correct date.
10. Make the date change to CHANGELOG.md if necessary and stage the changes with `git add . && git commit -m "updates changelog date"`.
11. Then, run `git checkout staging && git add . && npx lerna version --no-push`
11. Then, run `git checkout staging && git add . && yarn version --no-push`
- This will prompt you for a new version number, apply the Git tags, and update the version number in the `package.json` of each child project.
- This will also automatically commit the changes with a generated commit message.
12. Push changes to staging with `git push origin staging && git push origin --tags`
Expand All @@ -47,7 +47,7 @@ When you plan on releasing a new version of Cloud Manager:
15. Once your new version has being deployed to production, open a PR to merge `master` branch into `develop` branch - **DO NOT SQUASH MERGE**
- Seriously...**DO NOT SQUASH MERGE**
16. Finally, on GitHub, create a new release from the Git tag you've just pushed to `master` branch. NOTE: when creating the GitHub release, the tag you pin the release to
should have the format vX.XX.XX. `lerna publish` creates tags such as "linode-manager@X.XX.XX", and GitHub will often autocomplete to these. Using these will break the link from
should have the format vX.XX.XX. `yarn publish` creates tags such as "linode-manager@X.XX.XX", and GitHub will often autocomplete to these. Using these will break the link from
the footer in Cloud to the current release. **Do not have an open PR if you plan on hotfixing to master. The build will not succeed if there is an open master -> develop PR**

## Pushing a Hotfix
Expand Down
8 changes: 3 additions & 5 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ yarn test linode
To run a test in debug mode, add a `debugger` breakpoint inside one of the test cases, then run

```
npx lerna run test:debug --stream --scope linode-manager
yarn workspace linode-manager run test:debug
```

Test execution will stop at the debugger statement, and you will be able to use Chrome's normal debugger to step through
Expand Down Expand Up @@ -209,10 +209,8 @@ The axe-core accessibility testing script has been integrated into the webdriver
```
# Starts the local development environment
yarn && npx lerna bootstrap --scope linode-manager && npx lerna run start --stream --scope linode-manager
npx lerna run axe --stream --scope linode-manager
yarn install:all && yarn up
yarn workspace linode-manager run axe
```

The test results will be saved as a JSON file with Critical accessibility violations appearing at the top of the list.
39 changes: 23 additions & 16 deletions generate_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,52 @@ def checkKeyWords(list_keywords, commit):
return True
return False

# Given a commit message from a merged Pull Request, remove the PR ID.
# Example: "My first commit (#1)" -> "My first commit"
def remove_pull_request_id(commit_message):
regexp = "\(#\d+\)"
return re.sub(regexp, '', commit_message).strip()

def generateChangeLog(release, date, origin):
git_diff=subprocess.Popen(['git', 'log', '--no-merges', '--oneline', "--pretty=split:'%s'", origin+'/master...HEAD'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout,stderr = git_diff.communicate()
clean_sdout = str(stdout).replace('b\"', '').replace('\n', '').replace('\\n','').replace("'", '').replace('\"','')
commit_array=clean_sdout.split('split:')
commit_array.pop(0)
git_log_command = ["git", "log", "--no-merges", "--oneline", "--pretty='%s'", "{}/master...HEAD".format(origin)]

commits = subprocess.check_output(git_log_command, subprocess.STDOUT).decode('utf-8').split('\n')

# Strip the first and last characters of each line, which are single quotes.
commits = [c[1:-1] for c in commits]

breaking=[]
added=[]
changed=[]
fixed=[]
jql_query=[]

for i,commit in enumerate(commit_array):
jira_key_regex=re.match('(''|\s)M3(-|\s)\d{1,5}(-|\s|:)', commit)
if( not (jira_key_regex is None) ):
for commit in commits:
commit = remove_pull_request_id(commit)

jira_key_regex=re.match('M3-\d{4}', commit)
if (jira_key_regex is not None):
jira_key=jira_key_regex.group(0)
jql_query.append(jira_key)
commit_array[i]=commit.lstrip(jira_key)
commit.lstrip(jira_key)

if(checkKeyWords(TEST_KEYWORDS, commit.lower())):
NOT_INCLUDED_IN_LOG.append(commit_array[i])
NOT_INCLUDED_IN_LOG.append(commit)
continue

if(checkKeyWords(BREAKING_KEYWORDS, commit.lower())):
breaking.append(commit_array[i])
breaking.append(commit)
continue

if(checkKeyWords(CHANGED_KEYWORDS, commit.lower())):
changed.append(commit_array[i])
changed.append(commit)
continue

if(checkKeyWords(FIXED_KEYWORDS, commit.lower())):
fixed.append(commit_array[i])
fixed.append(commit)
continue

added.append(commit_array[i])
added.append(commit)


generateJQLQuery(jql_query)
Expand Down
9 changes: 0 additions & 9 deletions lerna.json

This file was deleted.

23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"license": "Apache-2.0",
"devDependencies": {
"audit-ci": "^2.4.2",
"husky": "^3.0.1",
"lerna": "^3.18.4",
"postinstall": "^0.6.0",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
Expand All @@ -15,29 +15,33 @@
},
"husky": {
"hooks": {
"pre-commit": "lerna run precommit --stream",
"pre-push": "lerna run prepush --stream --scope linode-manager"
"pre-commit": "yarn workspaces run precommit",
"pre-push": "yarn workspace linode-manager prepush"
}
},
"scripts": {
"cost-of-modules": "yarn global add cost-of-modules && cost-of-modules --less --no-install --include-dev",
"install:all": "yarn install --frozen-lockfile && lerna link",
"install:all": "yarn install --frozen-lockfile",
"up": "yarn install:all && yarn start:all",
"postinstall": "yarn workspaces run postinstall",
"build": "yarn workspaces run build",
"up:manager": "yarn install:all && yarn start:manager",
"start:manager": "yarn workspace linode-js-sdk build && lerna run start --stream --scope linode-manager -- --color",
"start:manager": "yarn workspace linode-js-sdk build && yarn workspace linode-manager start --color",
"start:docker": "yarn workspace linode-js-sdk build && yarn start:all",
"start:all": "lerna run start --parallel -- --color",
"clean": "rm -rf node_modules && rm -rf packages/linode-js-sdk/node_modules && rm -rf packages/manager/node_modules && lerna clean --yes",
"start:all": "concurrently \"yarn workspace linode-js-sdk start\" \"yarn workspace linode-manager start\"",
"clean": "rm -rf node_modules && rm -rf packages/linode-js-sdk/node_modules && rm -rf packages/manager/node_modules",
"test": "yarn workspace linode-manager test",
"selenium": "yarn workspace linode-manager selenium",
"storybook": "yarn workspace linode-manager storybook",
"storybook:e2e": "yarn workspace linode-manager run storybook:e2e",
"storybook:debug": "lerna run storybook:e2e --stream --scope linode-manager -- --color --debug",
"storybook:debug": "yarn workspace linode-manager storybook:e2e --color --debug",
"e2e": "yarn workspace linode-manager e2e --color",
"e2e:all": "yarn workspace linode-manager e2e:all --color",
"e2e:modified": "yarn workspace linode-manager e2e:modified --color",
"cy:stage2e": "yarn workspace linode-manager cy:stage2e",
"cy:stagedebug": "yarn workspace linode-manager cy:stagedebug",
"cy:e2e": "yarn workspace linode-manager cy:e2e",
"cy:debug": "yarn workspace linode-manager cy:debug",
"docker:e2e": "docker-compose -f integration-test.yml up --exit-code-from manager-e2e",
"docker:test": "docker build -f Dockerfile . -t 'manager' && docker run -it cloud --rm -v $(pwd)/packages/manager/src:/home/node/app/packages/manager/src -v $(pwd)/packages/linode-js-sdk/src:/home/node/app/packages/linode-js-sdk/src manager test",
"docker:local": "docker build -f Dockerfile . -t 'manager' -t 'dev' && docker run -it --rm -p 3000:3000 -v $(pwd)/packages/manager/src:/home/node/app/packages/manager/src -v $(pwd)/packages/linode-js-sdk/src:/home/node/app/packages/linode-js-sdk/src manager start:docker",
Expand All @@ -52,5 +56,6 @@
"packages": [
"packages/*"
]
}
},
"version": "0.0.0"
}
4 changes: 2 additions & 2 deletions packages/linode-js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linode-js-sdk",
"version": "0.17.0-alpha.0",
"version": "0.19.0-alpha.0",
"homepage": "https://github.com/linode/manager/tree/develop/packages/linode-js-sdk",
"bugs": {
"url": "https://github.com/linode/manager/issues",
Expand All @@ -21,7 +21,7 @@
"types": "./lib/index.d.ts",
"unpkg": "./index.js",
"dependencies": {
"axios": "^0.19.0",
"axios": "~0.19.0",
"querystring": "^0.2.0",
"ramda": "^0.26.1",
"yup": "^0.27.0"
Expand Down
Loading

0 comments on commit e08fce0

Please sign in to comment.