Skip to content

oaiFeat: Cli integration test #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
0c76fd0
chore: fix auditing vulnerabilities
manisha1997 Apr 19, 2025
abbb4eb
chore: fix auditing vulnerabilities
manisha1997 Apr 19, 2025
58f9139
chore: update cli core tag
manisha1997 Apr 23, 2025
6f87cdc
chore: add tag
manisha1997 Apr 24, 2025
fd95622
chore: add tag
manisha1997 Apr 24, 2025
b9c525b
chore: add tag
manisha1997 Apr 24, 2025
cc95efe
chore: Update package.json
manisha1997 Apr 24, 2025
c0cca72
chore: add tag
manisha1997 Apr 24, 2025
c3da8a3
chore: fix test case
manisha1997 Apr 26, 2025
2c31d95
chore: fix test case
manisha1997 Apr 26, 2025
f863733
chore: fix test case
manisha1997 Apr 26, 2025
edb4dcf
chore: fix linting error
manisha1997 Apr 28, 2025
085638e
chore: fix vulnerabilities
manisha1997 Apr 28, 2025
81c2f9b
chore: fix vulnerabilities
manisha1997 Apr 28, 2025
d533503
chore: add cli core tag
manisha1997 May 6, 2025
27ed812
chore: add cli core tag
manisha1997 May 6, 2025
0cf3aed
chore: add cli core tag
manisha1997 May 6, 2025
b41b8fe
chore: add cli core tag
manisha1997 May 6, 2025
bbe1bf4
chore: add cli core tag
manisha1997 May 6, 2025
83ff1f3
chore: add cli core tag
manisha1997 May 6, 2025
7df7bc9
chore: add cli core tag
manisha1997 May 7, 2025
6b6a6da
chore: update release
manisha1997 May 7, 2025
b7f11cf
chore: add cli core tag
manisha1997 May 7, 2025
0db9bcc
chore: add cli core tag
manisha1997 May 7, 2025
b9c6d56
chore: add cli core tag
manisha1997 May 7, 2025
1c86537
chore: add cli core tag
manisha1997 May 7, 2025
e314cca
chore: add cli core tag
manisha1997 May 7, 2025
17c7772
chore: add cli core tag
manisha1997 May 7, 2025
24b7575
chore: add cli core tag
manisha1997 May 7, 2025
497c50f
chore: add cli core tag
manisha1997 May 7, 2025
dca4bd6
chore: add cli core tag
manisha1997 May 7, 2025
e9b0814
chore: add cli core tag
manisha1997 May 7, 2025
a323e4a
chore: add cli core tag
manisha1997 May 7, 2025
d502380
chore: add cli core tag
manisha1997 May 7, 2025
4b36741
chore: add cli core tag
manisha1997 May 7, 2025
4360a4e
chore: add cli core tag
manisha1997 May 7, 2025
07dace7
chore: add cli core tag
manisha1997 May 8, 2025
272e8fe
chore: add cli core tag
manisha1997 May 8, 2025
eea9c71
chore: add cli core tag
manisha1997 May 8, 2025
248cb71
chore: add cli core tag
manisha1997 May 8, 2025
f7ef4d9
chore: add cli core tag
manisha1997 May 8, 2025
afe53ae
chore: add cli core tag
manisha1997 May 9, 2025
81084a7
chore: add cli core tag
manisha1997 May 9, 2025
83628ad
fix: add dummy commit
manisha1997 May 9, 2025
f9f03ca
fix: add dummy commit (#273)
manisha1997 May 13, 2025
ad3b2ff
fix: test release
manisha1997 May 15, 2025
77b1742
fix: test release
manisha1997 May 15, 2025
202266f
chore: update .releaserc.json
manisha1997 May 15, 2025
5a2cf03
chore: Update release.yml
manisha1997 May 15, 2025
70664b3
fix: test release
manisha1997 May 15, 2025
f1450ff
fix: test release
manisha1997 May 15, 2025
f7c3671
chore: Update .releaserc.json
manisha1997 May 15, 2025
cc2a30c
oaiFix: Update README.md (#274)
manisha1997 May 15, 2025
a219728
fix: test release
manisha1997 May 15, 2025
463d734
fix: test release
manisha1997 May 15, 2025
80e4979
fix: test release
manisha1997 May 15, 2025
eccd706
fix: test release
manisha1997 May 16, 2025
2a29e05
fix: test release
manisha1997 May 16, 2025
7b65d16
fix: test release
manisha1997 May 16, 2025
0c4f1cb
fix: test release
manisha1997 May 16, 2025
2afbdc4
fix: test release
manisha1997 May 16, 2025
86a57fb
fix: test release
manisha1997 May 16, 2025
14cb125
fix: test release
manisha1997 May 16, 2025
04e6097
fix: test release
manisha1997 May 16, 2025
0a4d330
oaiFeat: Updated api definitions
twilio-dx May 16, 2025
2358214
chore(release): set `package.json` to 1.0.0-alpha.1 [skip ci]
semantic-release-bot May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
"sonarjs/no-identical-functions": "off",
"sonarjs/no-collapsible-if": "off",
"sonarjs/prefer-immediate-return": "off",
"no-throw-literal": "off"
"no-throw-literal": "off",
"max-classes-per-file": ["error", 3]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this line added? How will this change impact?

}
}
31 changes: 30 additions & 1 deletion .github/scripts/update-release.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const core = require('@actions/core');
const { Octokit } = require("@octokit/core");
const path = require('path');
const fs = require('fs');

/**
* Functionality from tubone24/update_release.
@@ -12,6 +14,13 @@ const updateRelease = async () => {
})
const [owner, repo] = process.env.REPO_NAME ? process.env.REPO_NAME.split('/') : [null, null];
const tag = process.env.TAG_NAME;
const githubWorkspace = process.env.GITHUB_WORKSPACE;

console.log("GITHUB_WORKSPACE: ", githubWorkspace);

if( !process.env.GITHUB_WORKSPACE.includes('twilio-cli-core') ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case when workspace is 'twilio-cli' right? Can we check for that here? Since we ultimately want to update the cli core tag in twilio-cli

updatePackageJson(process.env.CLI_CORE_TAG)
}

//https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name
const getReleaseResponse = await octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}',{
@@ -54,7 +63,7 @@ const updateRelease = async () => {
prerelease = oldPrerelease;
}

//https://docs.github.com/en/rest/releases/releases#update-a-release
// https://docs.github.com/en/rest/releases/releases#update-a-release
await octokit.request('PATCH /repos/{owner}/{repo}/releases/{release_id}', {
owner,
release_id: oldReleaseId,
@@ -71,6 +80,26 @@ const updateRelease = async () => {
}
};

const updatePackageJson = (value) => {
try {
// Path to package.json
const packageJsonPath = path.resolve(process.cwd(), 'package.json');

// Read and parse package.json
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));

// Update the desired key
packageJson["dependencies"]["@twilio/cli-core"] = value;

// Write the updated object back to package.json
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');

console.info(`Updated package.json: Set twilio-cli-core to '${value}'`);
} catch (error) {
console.error(`Failed to update package.json: ${error.message}`);
}
};

module.exports = {
updateRelease,
};
6 changes: 3 additions & 3 deletions .github/workflows/cli-core-audit.yml
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 16.x, 14.x]
node-version: [lts/*, 22.x, 20.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
@@ -32,7 +32,7 @@ jobs:
name: Notify Npm Audit Failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
8 changes: 4 additions & 4 deletions .github/workflows/cli-core-test.yml
Original file line number Diff line number Diff line change
@@ -10,16 +10,16 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 16.x, 14.x]
node-version: [lts/*, 22.x, 20.x]
steps:
- name: Checkout cli core repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- run: make install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
@@ -36,7 +36,7 @@ jobs:
name: Notify Test Failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
34 changes: 18 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -87,13 +87,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [20.x, 22.x, lts/*]
steps:
- name: Checkout cli-core repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- run: make install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
@@ -135,7 +135,7 @@ jobs:
tag-name: ${{ steps.semantic-release.outputs.TAG_NAME }}
steps:
- name: Checkout cli-core repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false
- run: |
@@ -147,25 +147,26 @@ jobs:
node-version: 18.x
- name: semanticRelease
id: semantic-release
run: DEBUG=semantic-release:* npx semantic-release -t \${version}
run: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are merging it now, we should remove the dry-run flag right?

DEBUG=semantic-release:* npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update release
run: |
fileName="$GITHUB_WORKSPACE/.github/scripts/update-release.js"
node -e "require('$fileName').updateRelease()"
env:
REPO_ACCESS_TOKEN: ${{ github.token }}
TAG_NAME: ${{ steps.semantic-release.outputs.TAG_NAME }}
RELEASE_BODY: ${{needs.update-api-specs.outputs.change-log}}
REPO_NAME: ${{ github.repository }}
# - name: Update release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are merging it now, we should uncomment this step right?

# run: |
# fileName="$GITHUB_WORKSPACE/.github/scripts/update-release.js"
# node -e "require('$fileName').updateRelease()"
# env:
# REPO_ACCESS_TOKEN: ${{ github.token }}
# TAG_NAME: ${{ steps.semantic-release.outputs.TAG_NAME }}
# RELEASE_BODY: ${{needs.update-api-specs.outputs.change-log}}
# REPO_NAME: ${{ github.repository }}
triggerCliWorkflow:
runs-on: ubuntu-latest
needs: [ update-api-specs, release]
steps:
- name: Checkout cli-core repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- run: |
git pull
make install
@@ -178,7 +179,8 @@ jobs:
WORKFLOW_NAME: 'release.yml'
BRANCH_NAME: ${{github.event.inputs.cli-branch}}
REPO_NAME: ${{ github.repository_owner }}/twilio-cli
INPUTS: '{ "change-log": ${{ toJSON(needs.update-api-specs.outputs.change-log) }}, "version-type": "${{needs.update-api-specs.outputs.version-type}}", "homebrew-branch": "${{github.event.inputs.homebrew-branch}}", "homebrew-prerelease": "${{github.event.inputs.homebrew-prerelease}}" }'
INPUTS: '{ "change-log": "changelog3", "version-type": "2", "homebrew-branch": "${{github.event.inputs.homebrew-branch}}", "homebrew-prerelease": "${{github.event.inputs.homebrew-prerelease}}" }'
CLI_CORE_TAG: ${{ needs.release.outputs.tag-name }}
# notify-complete-fail:
# if: ${{ (needs.cli-token-validation.result != 'failure' || needs.cli-core-token-validation.result != 'failure' ) && (failure() || cancelled()) }}
# needs: [ triggerCliWorkflow ]
13 changes: 9 additions & 4 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
"branches": [
"main",
{
"name": "release-feature-branch",
"prerelease": "rc"
"name": "cli-integration-test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are not releasing from custom branch, we do not need this change anymore I guess.

"prerelease": "alpha"
}
],
"plugins": [
@@ -58,11 +58,16 @@
"changelogFile": "CHANGES.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/npm",{
"npmPublish": false
}
],
[
"@semantic-release/github",
{
"successComment": false
"successComment": false,
"npmPublish": false
}
],
[
Loading