Skip to content

Commit

Permalink
Merge pull request #144 from IBM/release-v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
freemanlatrell authored Jan 17, 2024
2 parents de7af47 + fac2f2a commit 1a332ef
Show file tree
Hide file tree
Showing 29 changed files with 2,085 additions and 289 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
fetch-depth: 0
ref: ${{ env.RELEASE_TAG }}

- name: Git origin branch
run: |
TAG_COMMIT=$(git rev-list -n 1 ${RELEASE_TAG})
echo "ORIGIN_BRANCH=$(git branch -r --contains ${TAG_COMMIT} | grep -e '->' | awk '{ print $3}')" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -34,10 +39,17 @@ jobs:
run: npm install -g @vscode/vsce

- name: Build Extension
if: ${{ env.ORIGIN_BRANCH == 'origin/main' }}
run: |
npm run build
echo "EXTENSION_LOCATION=$(ls ${GITHUB_WORKSPACE}/*.vsix)" >> $GITHUB_ENV
- name: Build Pre-Release Extension
if: ${{ env.ORIGIN_BRANCH != 'origin/main' }}
run: |
npm run build-prerelease
echo "EXTENSION_LOCATION=$(ls ${GITHUB_WORKSPACE}/*.vsix)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: oc-sdk-extension
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
os: [ubuntu-latest]

steps:
- name: Check-out repository for Branch builds
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

### v1.1.0
- Prevent error messages and response delays when connectivity to OpenShift and Ansible Galaxy connectivity is disrupted
- Added documentation note about lack of Windows OS support.
- Added ability to copy error message from toast notification
- Restrict redeploy collection command when signature validation is required
- Added support for scaffolding files, an operator-sdk submenu, and quick-fix actions for the linter.
- Local ZosEndpoint fixes
- Added '-' and '_' as valid characters in sha256 token regex.
- Added support for operator collection workspace initialization

### v1.0.1
- Bypass 401 failures when extension activates but user isn't logged into OpenShift

Expand Down
56 changes: 56 additions & 0 deletions LINTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# IBM Operator Collection SDK for VS Code integrated linter configuration

The IBM Operator Collection SDK for VS Code has a built-in linter meant to validate your operator-config,
By default the following rules are applied:

- `missing-galaxy`
- Missing `galaxy.yaml` file errors.
- `match-domain`
- `galaxy.yml` file `domain` mismatch
- `match-name`
- `galaxy.yml` file `name` mismatch
- `match-version`
- `galaxy.yml` file `version` mismatch
- `ansible-config`
- Build includes `ansible.cfg` error
- `playbook-path`
- Playbook relative path validation error
- `hosts-all`
- Playbook hosts validation
- `missing-playbook`
- Validate Playbook existence
- `finalizer-path`
- Finalizer relative path validation error
- `missing-finalizer`
- Validate Finalizer existence

You can customize the linter rules and files to ignore to suit your needs. You can ignore certain rules, enable rules, and ignore files from linting.

The IBM Operator Collection SDK for VS Code Operator Collection Linter loads configuration from a file in the directory where the operator-config is located,
Specify this configuration in `.oc-lint` a yaml file that contains the following format:

```
---
# .oc-lint
# List of files for the linter to ignore.
exclude_paths:
- '**'
# Use all the default linter rules
use_default_rules: true
# List of rules to skip linting.
skip_list:
- match-domain
# List of additional rules to enable.
enable_list:
- hosts-all
```

Where:
- `exlude_paths` defines a glob pattern to ignore when matching against the files the linter will process.
- `use_default_rules` Enables all the linting rules to be applied.
- `skip_list` Lists all the rules you want disabled.
- `enable_list` Lists all the rules you want to explicitly enable.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# IBM Operator Collection SDK for VS Code

> **Note:** This extension is not supported on Windows OS.
The IBM Operator Collection SDK extension simplifies the Operator Collection development experience by allowing you to manage the deployment of your operator in OpenShift, and the ability to debug direcly from your VS Code editor.

## Features
Expand Down Expand Up @@ -28,6 +30,23 @@ Configure your OpenShift server URL, and select your OpenShift Project directly

![OpenShift configuration](./resources/docs/media/oc-cluster-login-url-and-token.gif)

## Quickly generate operator collections and files from scratch using the sub-menu

- Initialize new operator collections in seconds
- Scaffold `operator-config`, `galaxy`, and `playbook` boilerplate files.
- Convert a collection to air-gapped collection using single-click actions

![Scaffold collection](./resources/docs/media/oc-sdk-scaffold-collection.gif)

## Dynamic linting and code completion

- Instant `operator-config` validation and code completion
- Display `operator-config` property descriptions

![Operator Collection Linter](./resources/docs/media/oc-sdk-vs-code-linter.gif)



## Trouble Shooting

If you experience issues with `urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]`, or similar issues, you may need to install and use SSL Certificates before running this extension.
Expand Down
98 changes: 89 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"icon": "resources/icons/operator-collection-sdk.png",
"description": "IBM Operator Collection SDK VS Code extension for Operator Collection development",
"version": "1.0.1",
"version": "1.1.0",
"repository": {
"type": "git",
"url": "https://github.com/IBM/operator-collection-sdk-vscode-extension"
Expand Down Expand Up @@ -145,6 +145,41 @@
"title": "Delete Custom Resource",
"category": "OC-SDK",
"icon": "$(trash)"
},
{
"command": "operator-collection-sdk.refactorInline",
"title": "Refactor YAML file inline",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.createFile",
"title": "Create boilerplate YAML file",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.createGalaxyBoilerplateFile",
"title": "New galaxy file...",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.createOperatorConfigBoilerplateFile",
"title": "New operator-config file...",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.createPlaybookBoilerplateFile",
"title": "New playbook file...",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.convertToAirgapCollection",
"title": "Convert to Airgap Collection",
"category": "OC-SDK"
},
{
"command": "operator-collection-sdk.initCollection",
"title": "New Operator Collection...",
"category": "OC-SDK"
}
],
"configuration": [
Expand Down Expand Up @@ -220,17 +255,27 @@
{
"view": "operator-collection-sdk.operators",
"contents": "A new IBM Operator Collection version is available\n[Update Now](command:operator-collection-sdk.sdkUpgradeVersion)\n[Later](command:operator-collection-sdk.sdkUpgradeVersionSkip)",
"when": "operator-collection-sdk.sdkInstalled && operator-collection-sdk.sdkOutdatedVersion"
"when": "operator-collection-sdk.sdkInstalled && operator-collection-sdk.sdkOutdatedVersion && workspaceFolderCount!=0"
},
{
"view": "operator-collection-sdk.operators",
"contents": "Install the IBM z/OS Cloud Broker Operator in the current project in OpenShift, and create a ZosCloudBroker instance to use this extension",
"when": "operator-collection-sdk.loggedIn && !operator-collection-sdk.zosCloudBrokerInstalled && operator-collection-sdk.validNamespace"
"when": "operator-collection-sdk.loggedIn && !operator-collection-sdk.zosCloudBrokerInstalled && operator-collection-sdk.validNamespace && !operator-collection-sdk.isCollectionInWorkspace"
},
{
"view": "operator-collection-sdk.operators",
"contents": "Select a valid project in Openshift and create a ZosCloudBroker instance to use this extension",
"when": "operator-collection-sdk.loggedIn && !operator-collection-sdk.zosCloudBrokerInstalled && !operator-collection-sdk.validNamespace"
"when": "operator-collection-sdk.loggedIn && !operator-collection-sdk.zosCloudBrokerInstalled && !operator-collection-sdk.validNamespace &&operator-collection-sdk.isCollectionInWorkspace"
},
{
"view": "operator-collection-sdk.operators",
"contents": "Operator Collection isn’t detected in current workspace \n[Initialize Operator Collection](command:operator-collection-sdk.initCollectionAtRoot)\n[Skip](command:operator-collection-sdk.initCollectionSkip)",
"when": "operator-collection-sdk.sdkInstalled && !operator-collection-sdk.sdkOutdatedVersion && operator-collection-sdk.isCollectionInWorkspace && workspaceFolderCount!=0"
},
{
"view": "operator-collection-sdk.operators",
"contents": "You have not yet opened a folder. \n[Open Folder](command:workbench.action.files.openFileFolder)\nYou can clone a repository locally.\n[Clone Repository](command:git.clone)",
"when": "workspaceFolderCount==0"
},
{
"view": "operator-collection-sdk.resources",
Expand All @@ -252,11 +297,6 @@
"contents": "Log in to an OpenShift Cluster to use this extension\n[Log in to OpenShift](command:operator-collection-sdk.login)",
"when": "!operator-collection-sdk.loggedIn"
},
{
"view": "operator-collection-sdk.operators",
"contents": "Log in to an OpenShift Cluster to use this extension",
"when": "!operator-collection-sdk.loggedIn && operator-collection-sdk.sdkInstalled"
},
{
"view": "operator-collection-sdk.about",
"contents": "IBM Operator Collection SDK and IBM z/OS Cloud Broker Operator not installed",
Expand All @@ -272,7 +312,43 @@
}
]
},
"submenus": [
{
"id": "operator-collection-sdk.submenu",
"label": "Operator Collection SDK",
"group": "submenu"
}
],
"menus": {
"explorer/context": [
{
"submenu": "operator-collection-sdk.submenu",
"group": "navigation@100",
"when": "explorerResourceIsFolder"
}
],
"operator-collection-sdk.submenu": [
{
"command": "operator-collection-sdk.createGalaxyBoilerplateFile",
"group": "ocsdk-submenu@0"
},
{
"command": "operator-collection-sdk.createPlaybookBoilerplateFile",
"group": "ocsdk-submenu@1"
},
{
"command": "operator-collection-sdk.createOperatorConfigBoilerplateFile",
"group": "ocsdk-submenu@2"
},
{
"command": "operator-collection-sdk.convertToAirgapCollection",
"group": "ocsdk-submenu@3"
},
{
"command": "operator-collection-sdk.initCollection",
"group": "ocsdk-submenu@4"
}
],
"view/title": [
{
"command": "operator-collection-sdk.refreshAll",
Expand Down Expand Up @@ -425,6 +501,10 @@
{
"fileMatch": "operator-config.yml",
"url": "./resources/schema/operator-config.schema.json"
},
{
"fileMatch": ".oc-lint",
"url": "./resources/schema/oc-lint.schema.json"
}
]
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/docs/media/oc-sdk-vs-code-linter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions resources/schema/oc-lint.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/OcLinterConfig",
"definitions": {
"Rule": {
"type": "string",
"oneOf": [
{"const":"missing-galaxy",
"markdownDescription": "#### Description\r\nMissing `galaxy.yaml` file errors."
},
{"const":"match-domain",
"markdownDescription": "#### Description\r\n`galaxy.yml` file domain mismatch"
},
{"const":"match-name",
"markdownDescription": "#### Description\r\n`galaxy.yml` file name mismatch"
},
{"const":"match-version",
"markdownDescription": "#### Description\r\n`galaxy.yml` file version mismatch"
},
{"const":"ansible-config",
"markdownDescription": "#### Description\r\nBuild includes `ansible.cfg` error"
},
{"const":"playbook-path",
"markdownDescription": "#### Description\r\nPlaybook relative path validation error"
},
{"const":"hosts-all",
"markdownDescription": "#### Description\r\nPlaybook hosts validation"
},
{"const":"finalizer-path",
"markdownDescription": "#### Description\r\nFinalizer relative path validation error"
},
{"const":"missing-finalizer",
"markdownDescription": "#### Description\r\nValidate Finalizer existence"
},
{"const":"missing-playbook",
"markdownDescription": "#### Description\r\nValidate Playbook existence"
}
]
},
"OcLinterConfig": {
"type": "object",
"additionalProperties": false,
"properties": {
"exclude_paths": {
"markdownDescription": "#### Description\r\nList of files for the linter to ignore.",
"type": "array",
"items": {
"type": "string"
}
},
"use_default_rules": {
"markdownDescription": "#### Description\r\nUse all the default linter rules.",
"type": "boolean"
},
"skip_list": {
"markdownDescription": "#### Description\r\nList of rules to skip linting.",
"type": "array",
"items": {
"type": "string",
"$ref": "#/definitions/Rule"
}
},
"enable_list": {
"markdownDescription": "#### Description\r\nList of additional rules to enable.",
"type": "array",
"items": {
"type": "string",
"$ref": "#/definitions/Rule"
}
}
},
"required": []
}
}
}
6 changes: 3 additions & 3 deletions resources/schema/operator-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
"domain": {
"type": "string",
"maxLength": 253,
"pattern": "^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,253}$",
"pattern": "^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,253}$|^{{\\s*.+\\s*}}$",
"markdownDescription": "#### Description\r\nA unique value that will be used to construct the Kubernetes API group for the `resources` defined in this `OperatorCollection`.\r\nThis value MUST conform to the Kubernetes DNS Subdomain naming scheme as defined in RFC 1123.\r\nThis value SHOULD be the same as the `namespace` value specified in an Ansible Collection's `galaxy.yml` file. In scenarios where forks/clones of an official Ansible Collection are desired, the `domain` value MAY be set to another unique, conforming"
},
"name": {
"type": "string",
"maxLength": 253,
"pattern": "^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,253}$",
"pattern": "^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,253}$|^{{\\s*.+\\s*}}$",
"markdownDescription": "#### Description\r\nA unique value that will be prepended to the `domain` value to construct a full Kubernetes API Group for the `resources` defined in this `OperatorCollection`.\r\nThis value MUST conform to the Kubernetes DNS Subdomain naming scheme as defined in RFC 1123.\r\nThis value SHOULD be the same as the `name` value specified in an Ansible Collection's `galaxy.yml` file. In scenarios where forks/clones of an official Ansible Collection are desired, the `name` value MAY be set to another unique, conforming, value."
},
"provider": {
Expand All @@ -124,7 +124,7 @@
},
"version": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:[+]([0-9a-zA-Z-]+(?:[.][0-9a-zA-Z-]+)*))?$",
"pattern": "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:[+]([0-9a-zA-Z-]+(?:[.][0-9a-zA-Z-]+)*))?$|^{{\\s*.+\\s*}}$",
"markdownDescription": "#### Description\r\nA semantic versioning compliant version number.\r\nThis value SHOULD be the same as the `version` value specified in an Ansible Collection's `galaxy.yml` file."
},
"icon": {
Expand Down
Loading

0 comments on commit 1a332ef

Please sign in to comment.