Skip to content

Commit

Permalink
Merge branch 'next' into ssh-keypassphrase-prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Jace Roell <111985297+jace-roell@users.noreply.github.com>
  • Loading branch information
jace-roell authored Aug 1, 2024
2 parents ae93e64 + b600db9 commit 20638f7
Show file tree
Hide file tree
Showing 59 changed files with 1,541 additions and 620 deletions.
65 changes: 65 additions & 0 deletions .github/updateReleaseMarkdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const fs = require('fs');
const path = require('path');

const mdFilePath = path.join(__dirname, '../RELEASE_HISTORY.md');

// Build the new row to be added
const newRow = `| v${process.env.NEW_VERSION} | ${new Date().toISOString().split('T')[0].slice(0, 7)} | **Active** | [Release Notes](https://docs.zowe.org/stable/whats-new/release-notes/v${process.env.NEW_VERSION.replace(/\./g, '_')}) |`;

// Read, Update and Write to Markdown File
function updateReleaseHistory(newRow) {
fs.readFile(mdFilePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading the file:', err);
return;
}

// Find the table and insert the new row after the second row
const lines = data.split('\n');
let tableLineCount = 0;
for (let i = 0; i < lines.length; i++) {
if (lines[i].startsWith('|') && lines[i].endsWith('|')) {
tableLineCount++;
if (tableLineCount === 2) {
// Insert the new row after the second row
lines.splice(i + 1, 0, newRow);
break;
}
}
}

fs.writeFile(mdFilePath, lines.join('\n'), 'utf8', (err) => {
if (err) {
console.error('Error writing the file:', err);
return;
}
console.log('Markdown file updated successfully.');
});
});
}

// Update the zoweVersion in package.json
function updatePackageJsonVersion(newVersion) {
const packageJsonPath = path.join(__dirname, '../packages/cli/package.json');
fs.readFile(packageJsonPath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading package.json:', err);
return;
}

let packageJson = JSON.parse(data);
packageJson.zoweVersion = `v${newVersion}`;

fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', (err) => {
if (err) {
console.error('Error writing to package.json:', err);
return;
}
console.log('package.json updated successfully.');
});
});
}

// Execute the functions
updatePackageJsonVersion(process.env.NEW_VERSION);
updateReleaseHistory(newRow);
111 changes: 111 additions & 0 deletions .github/updateReleaseMarkdown_BROKEN.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
const fs = require('fs');
const path = require('path');
const https = require('https');

// This script is attempting to add whatever list of the CLI team is shown in the TSC repo https://raw.githubusercontent.com/zowe/community/master/COMMITTERS.md.
// Despite efforts, this is not working. Adam will always be cut off (possibly just whoever is first in the table).
// Leaving this code present and hoping that the problem with this file can be solved in the future.

// URL of the raw markdown file to be appended to RELEASE_HISTORY.md
const url = 'https://raw.githubusercontent.com/zowe/community/master/COMMITTERS.md';

// Build the new row to be added
const newVersion = process.env.NEW_VERSION;
const newRow = `| v${newVersion} | ${new Date().toISOString().split('T')[0].slice(0, 7)} | **Active** | [Release Notes](https://docs.zowe.org/stable/whats-new/release-notes/v${newVersion.replace(/\./g, '_')}) |`;

const mdFilePath = path.join(__dirname, '../RELEASE_HISTORY.md');

// Function to fetch CLI team from a URL
function fetchCliTeam(url) {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
let data = '';

// A chunk of data has been received
res.on('data', (chunk) => {
data += chunk;
});

// The whole response has been received
res.on('end', () => {
// Extract only the CLI contributors section
const cliSectionMatch = data.match(/### Zowe CLI Squad[\s\S]*?(?=###|$)/);
const cliSection = cliSectionMatch ? cliSectionMatch[0] : '';
resolve(cliSection);
});
}).on('error', (err) => {
reject(err);
});
});
}

// Function to remove existing CLI team section and append new one
function updateCliTeamInMd(cliTeam) {
// Read the current content of the markdown file
fs.readFile(mdFilePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading the file:', err);
return;
}

// Remove the old CLI squad section and replace it with the new one
const updatedData = data.replace(/### Zowe CLI Squad[\s\S]*?(?=###|$)/, cliTeam + '\n');

// Write the updated data back to the file
fs.writeFile(mdFilePath, updatedData, 'utf8', (err) => {
if (err) {
console.error('Error writing the file:', err);
return;
}
console.log('CLI team has been updated in RELEASE_HISTORY.md successfully.');
});
});
}

// Main function to fetch CLI team and update RELEASE_HISTORY
async function appendCliTeam() {
try {
const cliTeam = await fetchCliTeam(url);
updateCliTeamInMd(cliTeam);
} catch (error) {
console.error('Error fetching CLI team:', error);
}
}

// Read, Update and Write to Markdown File
function updateReleaseHistory(newRow) {
fs.readFile(mdFilePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading the file:', err);
return;
}

// Find the table and insert the new row after the second row
const lines = data.split('\n');
let tableLineCount = 0;
for (let i = 0; i < lines.length; i++) {
if (lines[i].startsWith('|') && lines[i].endsWith('|')) {
tableLineCount++;
if (tableLineCount === 2) {
// Insert the new row after the second row
lines.splice(i + 1, 0, newRow);
break;
}
}
}

fs.writeFile(mdFilePath, lines.join('\n'), 'utf8', (err) => {
if (err) {
console.error('Error writing the file:', err);
return;
}
console.log('Markdown file updated successfully.');
});
});
}

// Execute the two main functions
(async () => {
await appendCliTeam();
updateReleaseHistory(newRow);
})();
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/resources/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
74 changes: 74 additions & 0 deletions .github/workflows/zoweReleaseVersion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Update Zowe Version and Create PR

on:
workflow_dispatch:
inputs:
major_version:
description: 'Major version (default is 3)'
required: true
default: '3'
minor_version:
description: 'Minor version'
required: true
patch_version:
description: 'Patch version'
required: true

jobs:
update_versions_and_create_pr:
runs-on: ubuntu-latest

steps:
- name: Checkout CLI Repo
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Set Variables and Ensure Increase in Semver
id: get_zowe_versions
run: |
current_version=$(jq -r '.zoweVersion' packages/cli/package.json)
current_version="${current_version#v}" # Strip the 'v' prefix
echo "current_version=$current_version" >> $GITHUB_ENV
new_version="${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}"
echo "new_version=$new_version" >> $GITHUB_ENV
echo "PACKAGE_JSON_PATH=packages/cli/package.json" >> $GITHUB_ENV
if [[ "$new_version" < "$current_version" ]]; then
echo "Error: New version $new_version is not greater than current version $current_version."
exit 1
fi
- name: Create Branch
run: |
branch_name="update-version-v${{ env.new_version }}"
echo "branch_name=$branch_name" >> $GITHUB_ENV
git checkout -b "$branch_name"
- name: Update Zowe Version in cli/package.json
run: |
jq ".zoweVersion = \"v${{ env.new_version }}\"" ${{ env.PACKAGE_JSON_PATH }} > package.tmp.json && mv package.tmp.json ${{ env.PACKAGE_JSON_PATH }}
- name: Update RELEASE_HISTORY.md
run: node ".github/updateReleaseMarkdown.js"
env:
NEW_VERSION: ${{ env.new_version }}

- name: Commit and Push Changes
run: |
git config --global user.name "${{ secrets.ZOWE_ROBOT_USER }}"
git config --global user.email "${{ secrets.ZOWE_ROBOT_EMAIL }}"
git add "${{ env.PACKAGE_JSON_PATH }}"
git add "RELEASE_HISTORY.md"
git commit -sm "Update version to ${{ env.new_version }}"
git push origin "$branch_name"
- name: Create Pull Request
run: |
pr_title="Update CLI version to ${{ env.new_version }}"
base_branch="${{ github.ref_name }}"
gh pr create -t "$pr_title" -b "$base_branch" --head "$branch_name" --body "Updating Zowe CLI version to ${{ env.new_version }}" --reviewer zFernand0,t1m0thyj,awharn,gejohnston,traeok,jace-roell,ATorrise
env:
GH_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
69 changes: 69 additions & 0 deletions RELEASE_HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Zowe CLI Releases

Zowe follows a regular release schedule with major versions released every two years and minor versions approximately every six weeks. Full details regarding the Zowe release schedule are available on [zowe.org](https://www.zowe.org/download#timeline) and the Zowe Community [Github](https://github.com/zowe/community/blob/master/Technical-Steering-Committee/release.md).

## Zowe Release Schedule

### Zowe v3.x LTS Releases
| Version | Release Date | Status | Release Notes |
|:--------:|:------------:|:----------:|:-------------:|
| v3.0.0-prerelease | 2024-08 | **Under Development** | |

### Major Release Timeline

![Zowe Major Releases](https://raw.githubusercontent.com/zowe/zowe.github.io/master/assets/img/major_releases.webp)

### Version Timeframes

- **Active**: Each major version remains in this phase for 2 years, receiving regular updates and new features.
- **Maintenance**: Following the Active phase, each major version remains in this phase for an additional 2.5 years, receiving only critical fixes and security patches.
- **Under Development**: The pre-Active phase where the next major version is prepared. This phase varies in length and is not available for general consumption.

### Guarantees

- **Critical Defects Fixes**: The community will fix critical defects. The criteria for what constitutes a critical defect can be found [here](https://github.com/zowe/community/blob/master/Technical-Steering-Committee/release.md#active-release).
- **Extender Conformance**: Extenders achieving Zowe conformance for the long-term support version will not need to modify their product to remain functional when Zowe updates are provided within the same major version.

### Recommendations

- **Production**: Use **Active** or **Maintenance** releases for production due to the guaranteed stability and the community’s commitment to fixing critical defects.
- **Nightly Builds**: Available for integration testing. Use at your own risk.

## Zowe Release Process

### Short Summary

1. Code Freeze date is hit.
2. Each [squad](https://github.com/zowe/community/blob/master/Technical-Steering-Committee/squads.md) provides a version of the code to integrate into the Release Candidate (RC).
3. RC is built and tested with an automatic test suite.
4. RC is deployed and tested by squads.
5. RC is approved by the TSC vote.
6. Release is published.
7. Documentation is published.
8. Release retrospective is held.

### Release Numbering

Releases follow [semantic versioning](https://semver.org/) guidelines (MAJOR.MINOR.PATCH).

- **MAJOR**: Incompatible API changes.
- **MINOR**: Backwards-compatible functionality additions.
- **PATCH**: Backwards-compatible bug fixes.

### Release Content

The following [components of the release](https://github.com/zowe/community/blob/master/Technical-Steering-Committee/release.md#release-content) are managed by the CLI squad:

- **CLI Component**
- CLI Core
- CLI Plugins
- **Client SDKs**
- Node.js Client SDK
- Python Client SDK


## Zowe CLI Squad
- https://github.com/zowe/community/blob/master/COMMITTERS.md#zowe-cli-squad
- https://github.com/orgs/zowe/teams/zowe-cli-administrators
- https://github.com/orgs/zowe/teams/zowe-cli-committers
- https://github.com/orgs/zowe/teams/zowe-cli-contributors
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`Imperative Secure Tests imperative-test-cli config profiles should list profiles 1`] = `
"secured
base
project_base
global_base
"
`;
8 changes: 8 additions & 0 deletions __tests__/__packages__/cli-test-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe CLI test utils package will be documented in this file.

## `8.0.0-next.202407262216`

- Update: See `7.28.2` for details

## `8.0.0-next.202407021516`

- BugFix: Updated dependencies for technical currency [#2188](https://github.com/zowe/zowe-cli/pull/2188)
Expand All @@ -14,6 +18,10 @@ All notable changes to the Zowe CLI test utils package will be documented in thi

- Major: First major version bump for V3

## `7.28.2`

- BugFix: Improved the error message shown on Windows when `runCliScript` method cannot find `sh` executable on PATH. [#2208](https://github.com/zowe/zowe-cli/issues/2208)

## `7.18.11`

- BugFix: Fix types error from an incorrect jstree type during compilation
Expand Down
4 changes: 2 additions & 2 deletions __tests__/__packages__/cli-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/cli-test-utils",
"version": "8.0.0-next.202407181255",
"version": "8.0.0-next.202407311544",
"description": "Test utilities package for Zowe CLI plug-ins",
"author": "Zowe",
"license": "EPL-2.0",
Expand Down Expand Up @@ -43,7 +43,7 @@
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/uuid": "^10.0.0",
"@zowe/imperative": "8.0.0-next.202407181255"
"@zowe/imperative": "8.0.0-next.202407311544"
},
"peerDependencies": {
"@zowe/imperative": "^8.0.0-next"
Expand Down
Loading

0 comments on commit 20638f7

Please sign in to comment.