Skip to content

Conversation

@agrasth
Copy link
Contributor

@agrasth agrasth commented Jul 1, 2025

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

feat: Improve IDE setup with SIP-aware permission handling

Summary

Enhances VSCode and JetBrains IDE setup commands to work properly on macOS systems with System Integrity Protection (SIP) enabled.

Key Changes

  • VSCode: Add proactive permission checking for product.json editing
  • VSCode: Provide clear SIP protection error messages with manual setup instructions
  • JetBrains: Improve log message formatting for better readability
  • Documentation: Add comprehensive IDE setup guide

Problem Solved

Previously, IDE setup failed on SIP-enabled macOS without clear guidance, requiring users to disable SIP or manually configure repositories.

Impact

  • ✅ Works on SIP-enabled macOS (default security setting)
  • ✅ Clear error messages with actionable instructions
  • ✅ Improved user experience for IDE configuration
  • ✅ Maintains security best practices

agrasth added 5 commits June 27, 2025 01:55
- Add jfrog-cli-core/general/ide/vscode package with VSCode configuration logic
- Add jfrog-cli-core/general/ide/jetbrains package with JetBrains configuration logic
- Add jfrog-cli-core/general/ide/utils package with shared IDE utilities
- Implement cross-platform IDE detection and configuration
- Add backup mechanisms for configuration files
- Include SIP detection for macOS security requirements
- Support for multiple IDE versions and installations

Core implementation provides:
- VSCode product.json modification for extension marketplace
- JetBrains idea.properties configuration for plugin repository
- Automatic IDE installation detection
- Configuration backup and restore capabilities
- Cross-platform file permission handling

Part of SwampUp ticket implementation for IDE automated setup.
- Uncommented repository validation call in vscode.go
- Validation now properly checks repository accessibility before making changes
- Provides better error messages for repository configuration issues
- Ensures safe configuration process with early validation
…p management

- Add better System Integrity Protection (SIP) detection and guidance for macOS
- Implement structured backup directory in ~/.jfrog/backup/ide/vscode/
- Enhance permission error handling with specific guidance
- Add proper imports for core utilities and file operations
- Improve user experience with detailed setup instructions and fallback options
- Add proactive permission checking for VSCode product.json editing
- Provide clear SIP protection error messages and manual setup instructions
- Improve JetBrains setup log message formatting for better readability
- Add comprehensive IDE setup documentation

This enables VSCode and JetBrains IDE configuration to work properly
on macOS systems with System Integrity Protection (SIP) enabled.
- Remove vscode.go.backup file (should not be in repository)
- Remove .gradle/ directories with build cache and metadata files
- Remove Gradle execution history, file hashes, and build cleanup artifacts

These files are generated during development/build and should not be committed.
…stants

- Replace 404 with http.StatusNotFound
- Replace 401 with http.StatusUnauthorized
- Replace 403 with http.StatusForbidden

Fixes usestdlibvars linting issues in IDE setup code.
…ning 401 magic number

- Remove deprecated io/ioutil imports (SA1019 warning)
- Replace ioutil.ReadFile with os.ReadFile
- Replace ioutil.WriteFile with os.WriteFile
- Replace ioutil.ReadDir with os.ReadDir
- Replace remaining 401 magic number with http.StatusUnauthorized

Fixes staticcheck SA1019 and usestdlibvars linting issues in IDE setup code.
- Replace magic number 200 with http.StatusOK in vscode.go
- Replace unnecessary fmt.Sprintf calls with simpler string concatenation
- Fixes gosimple S1039 and usestdlibvars linting warnings
- Fix dupBranchBody by extracting common error handling logic in modifyProductJson
- Replace unnecessary fmt.Sprintf calls with simple string concatenation
- Fixes gocritic dupBranchBody and gosimple S1039 warnings
- Extract common command execution logic to eliminate duplicate branches
- Both Windows and non-Windows branches now only differ in executable name
- Fixes gocritic dupBranchBody warning in downloadAndInstallExtension function
- Update buildRepositoryURL to include /api/jetbrainsplugins/ path
- Change from: /artifactory/{repo}
- Change to: /artifactory/api/jetbrainsplugins/{repo}
- Applies to all operating systems (Windows, macOS, Linux)
- Manual setup instructions automatically reflect correct format
@agrasth
Copy link
Contributor Author

agrasth commented Jul 15, 2025

These changes are not needed anymore, as we have migrated the logic to jfrog-cli-artifactory.
reference: jfrog/jfrog-cli-artifactory#99

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.

1 participant