Skip to content

Add Contentstack Authentication toggle to project creation, Add support for choosing namespace in case of multiple github connections and Update package versions and server logs query - #213

Merged
chhavi-mandowara-cstk merged 6 commits into
stagingfrom
new-dev
Aug 5, 2026

Conversation

@chhavi-mandowara-cstk

Copy link
Copy Markdown
Contributor

feat: Add Contentstack Authentication toggle to project creation
feat: add support for choosing namespace in case of multiple github connections
fix: update GitHub connection URL to direct users to connected accounts settings
chore: bump cli-command to 1.8.4 and cli-utilities to 1.18.5
fix: Update get Server logs query to GetServerlessLogsV2 to match the updated windowed server logs query

Aravind-Kumar-cstk and others added 6 commits August 2, 2026 18:54
Set the isContentstackAuthenticationEnabled environment field when
creating a new Launch project, for both the GitHub and FileUpload
flows. Contentstack Authentication is enabled by default; users can
opt out with the new --disable-cs-auth flag or by answering "no" at
the interactive prompt (which defaults to enabled).

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…onnections.

- Added functionality to scope queries to the selected GitHub connection namespace in BaseClass methods detectFramework and selectBranch.
- Updated GitHub adapter to handle multiple user connections, allowing users to select a namespace or use a --namespace flag.
- Enhanced tests to cover new namespace selection logic and ensure proper handling of GitHub connections.
- Updated GraphQL queries and types to include namespace information for user connections.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Tejas Talekar <tejas.talekar@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 5, 2026 07:02
@chhavi-mandowara-cstk
chhavi-mandowara-cstk requested review from a team as code owners August 5, 2026 07:02
@snyk-io

snyk-io Bot commented Aug 5, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 23 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@chhavi-mandowara-cstk
chhavi-mandowara-cstk merged commit dfb510e into staging Aug 5, 2026
7 checks passed
@chhavi-mandowara-cstk
chhavi-mandowara-cstk deleted the new-dev branch August 5, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Launch CLI project-creation flows to support (1) a Contentstack Authentication toggle, (2) selecting a GitHub “namespace” when multiple GitHub connections exist, and (3) aligns server logs polling with the updated GetServerlessLogsV2 GraphQL API while bumping dependency versions.

Changes:

  • Added --enable-cs-auth/--disable-cs-auth flags + interactive prompt wiring for Contentstack Authentication in GitHub and File Upload project creation.
  • Added GitHub connection namespace support (GraphQL query + selection/prompting + scoping repo/branch/framework queries).
  • Updated serverless logs GraphQL query to GetServerlessLogsV2 and bumped package versions.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/unit/util/logs-polling-utilities.test.ts Updates mocked watch payload field to getServerlessLogsV2.
src/util/logs-polling-utilities.ts Reads serverless logs from data.getServerlessLogsV2.logs.
src/types/launch.ts Extends config typing with isContentstackAuthenticationEnabled and userConnection.namespace.
src/graphql/queries.ts Adds namespace to userConnections query; updates serverless logs query to V2; removes connectionUid from projects query selection.
src/commands/launch/logs.ts Fixes environment selection so deployments come from the selected environment.
src/commands/launch/index.ts Adds namespace, enable-cs-auth, and disable-cs-auth flags and updates help strings.
src/adapters/github.ts Implements cs-auth prompting/flags, namespace selection among multiple GitHub connections, and scopes repository queries by namespace.
src/adapters/github.test.ts Adds unit tests for namespace selection/scoping and cs-auth prompting/flags behavior.
src/adapters/file-upload.ts Implements cs-auth prompting/flags behavior for file-upload project creation.
src/adapters/file-upload.test.ts Adds unit tests for cs-auth prompting/flags behavior (table-driven for prompt answers).
src/adapters/base-class.ts Scopes framework detection and branch selection GraphQL queries by userConnection.namespace; updates GitHub connect URL.
src/adapters/base-class.test.ts Adds tests ensuring framework/branch queries include namespace.
package.json Bumps package version + dependency versions (cli-command, cli-utilities, adm-zip).
package-lock.json Lockfile updates reflecting bumped deps and transitive changes.
.talismanrc Updates package-lock checksum and adds checksum ignores for new/updated adapter tests.
.github/workflows/sca-scan.yml Adds explicit workflow permissions for SCA scan job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/adapters/github.ts
Comment on lines +263 to +276
if (enableCsAuth) {
this.config.isContentstackAuthenticationEnabled = true;
} else if (disableCsAuth) {
this.config.isContentstackAuthenticationEnabled = false;
} else {
this.config.isContentstackAuthenticationEnabled = (await ux.inquire({
type: 'confirm',
name: 'contentstackAuth',
message:
// eslint-disable-next-line max-len
'Enable Contentstack Authentication? Restricts access to this environment to members of your Contentstack organization.',
default: true,
})) as boolean;
}
Comment on lines +270 to +283
if (enableCsAuth) {
this.config.isContentstackAuthenticationEnabled = true;
} else if (disableCsAuth) {
this.config.isContentstackAuthenticationEnabled = false;
} else {
this.config.isContentstackAuthenticationEnabled = (await cliux.inquire({
type: 'confirm',
name: 'contentstackAuth',
message:
// eslint-disable-next-line max-len
'Enable Contentstack Authentication? Restricts access to this environment to members of your Contentstack organization.',
default: true,
})) as boolean;
}
Comment thread src/adapters/github.ts
Comment on lines +312 to +325
} else if (matchingConnections.length > 1) {
const selectedNamespace = await ux.inquire({
type: 'search-list',
name: 'userConnection',
message: 'Choose a GitHub Namespace',
choices: map(matchingConnections, (connection) => connection.namespace || connection.userUid),
});
userConnection = find(
matchingConnections,
(connection) => (connection.namespace || connection.userUid) === selectedNamespace,
);
} else {
userConnection = matchingConnections[0];
}
Comment on lines +8 to 12
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@master
Comment thread .talismanrc
Comment on lines 11 to +16
- filename: package-lock.json
checksum: ffb77989c6fe554cdd79ebe0cbd07c0ce4329dd65b3e9a9089db4abb7b9be2b3
checksum: c94ce0fbbbedcbad4dceef8168971831ed82aad85824db579f2497dcd49aecab
- filename: src/adapters/github.test.ts
checksum: b3d3d3a3c14adde103152d2ac4e1c4b7121a5f7533a87c3cc600f6d25fb59d1b
- filename: src/adapters/file-upload.test.ts
checksum: 962fd8b45578914926d20857ddc3d1bc2fa19e8b192c6dfdc03d214ae1898b59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants