Skip to content

Commit 7259179

Browse files
Alex HolmbergAlex Holmberg
authored andcommitted
Merge branch 'main' of github.com:syncable-dev/syncable-cli into develop
2 parents 5bf0a4a + b524dac commit 7259179

32 files changed

Lines changed: 2177 additions & 2508 deletions

.github/workflows/release-plz.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,45 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
release-plz-release:
10-
name: Release-plz release
14+
if: ${{ github.repository_owner == 'syncable-dev' }}
1115
runs-on: ubuntu-latest
12-
if: ${{ github.repository_owner == 'syncable-dev' }}
1316
permissions:
1417
contents: write
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
20+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
1521
steps:
1622
- name: Checkout repository
1723
uses: actions/checkout@v4
1824
with:
1925
fetch-depth: 0
20-
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
26+
token: ${{ secrets.RELEASE_PLZ_TOKEN }} # ← checkout must use the same token
2127
- name: Install Rust toolchain
2228
uses: dtolnay/rust-toolchain@stable
2329
- name: Run release-plz
2430
uses: release-plz/action@v0.5
2531
with:
2632
command: release
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
29-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
manifest_path: rust-mcp-server-syncable-cli/Cargo.toml
3034

3135
release-plz-pr:
32-
name: Release-plz PR
33-
runs-on: ubuntu-latest
3436
if: ${{ github.repository_owner == 'syncable-dev' }}
37+
runs-on: ubuntu-latest
3538
permissions:
3639
pull-requests: write
3740
contents: write
3841
concurrency:
3942
group: release-plz-${{ github.ref }}
4043
cancel-in-progress: false
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
46+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
4147
steps:
4248
- name: Checkout repository
4349
uses: actions/checkout@v4
@@ -46,10 +52,8 @@ jobs:
4652
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
4753
- name: Install Rust toolchain
4854
uses: dtolnay/rust-toolchain@stable
49-
- name: Run release-plz
55+
- name: Run release-plz PR
5056
uses: release-plz/action@v0.5
5157
with:
5258
command: release-pr
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
55-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}cl
59+
manifest_path: rust-mcp-server-syncable-cli/Cargo.toml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [0.11.1](https://github.com/syncable-dev/syncable-cli/compare/v0.11.0...v0.11.1) - 2025-06-20
10+
11+
### Added
12+
13+
- fixed double print
14+
15+
## [0.11.0](https://github.com/syncable-dev/syncable-cli/compare/v0.10.2...v0.11.0) - 2025-06-19
16+
17+
### Added
18+
19+
- feat; improved security:scaning printout
20+
- returning dependencies as a string, for MCP server opportunity
21+
- refactored handler logic - on to huge simplification and code breakdown
22+
923
## [0.10.2](https://github.com/syncable-dev/syncable-cli/compare/v0.10.1...v0.10.2) - 2025-06-19
1024

1125
### Added

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "syncable-cli"
3-
version = "0.10.2"
3+
version = "0.11.1"
44
edition = "2024"
55
authors = ["Syncable Team"]
66
description = "A Rust-based CLI that analyzes code repositories and generates Infrastructure as Code configurations"

src/analyzer/context/analysis.rs

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
use crate::analyzer::{
2+
AnalysisConfig, BuildScript, DetectedLanguage, DetectedTechnology, EntryPoint, EnvVar, Port,
3+
ProjectType,
4+
};
5+
use crate::error::Result;
6+
use std::collections::{HashMap, HashSet};
7+
use std::path::Path;
8+
9+
use super::file_analyzers::{docker, env, makefile};
10+
use super::language_analyzers::{go, javascript, jvm, python, rust};
11+
use super::microservices;
12+
use super::project_type;
13+
use super::tech_specific;
14+
15+
/// Project context information
16+
pub struct ProjectContext {
17+
pub entry_points: Vec<EntryPoint>,
18+
pub ports: Vec<Port>,
19+
pub environment_variables: Vec<EnvVar>,
20+
pub project_type: ProjectType,
21+
pub build_scripts: Vec<BuildScript>,
22+
}
23+
24+
/// Analyzes project context including entry points, ports, and environment variables
25+
pub fn analyze_context(
26+
project_root: &Path,
27+
languages: &[DetectedLanguage],
28+
technologies: &[DetectedTechnology],
29+
config: &AnalysisConfig,
30+
) -> Result<ProjectContext> {
31+
log::info!("Analyzing project context");
32+
33+
let mut entry_points = Vec::new();
34+
let mut ports = HashSet::new();
35+
let mut env_vars = HashMap::new();
36+
let mut build_scripts = Vec::new();
37+
38+
// Analyze based on detected languages
39+
for language in languages {
40+
match language.name.as_str() {
41+
"JavaScript" | "TypeScript" => {
42+
javascript::analyze_node_project(project_root, &mut entry_points, &mut ports, &mut env_vars, &mut build_scripts, config)?;
43+
}
44+
"Python" => {
45+
python::analyze_python_project(project_root, &mut entry_points, &mut ports, &mut env_vars, &mut build_scripts, config)?;
46+
}
47+
"Rust" => {
48+
rust::analyze_rust_project(project_root, &mut entry_points, &mut ports, &mut env_vars, &mut build_scripts, config)?;
49+
}
50+
"Go" => {
51+
go::analyze_go_project(project_root, &mut entry_points, &mut ports, &mut env_vars, &mut build_scripts, config)?;
52+
}
53+
"Java" | "Kotlin" => {
54+
jvm::analyze_jvm_project(project_root, &mut ports, &mut env_vars, &mut build_scripts, config)?;
55+
}
56+
_ => {}
57+
}
58+
}
59+
60+
// Analyze common configuration files
61+
docker::analyze_docker_files(project_root, &mut ports, &mut env_vars)?;
62+
env::analyze_env_files(project_root, &mut env_vars)?;
63+
makefile::analyze_makefile(project_root, &mut build_scripts)?;
64+
65+
// Technology-specific analysis
66+
for technology in technologies {
67+
tech_specific::analyze_technology_specifics(technology, project_root, &mut entry_points, &mut ports)?;
68+
}
69+
70+
// Detect microservices structure
71+
let microservices = microservices::detect_microservices_structure(project_root)?;
72+
73+
// Determine project type
74+
let ports_vec: Vec<Port> = ports.iter().cloned().collect();
75+
let project_type = project_type::determine_project_type_with_structure(
76+
languages,
77+
technologies,
78+
&entry_points,
79+
&ports_vec,
80+
&microservices,
81+
);
82+
83+
// Convert collections to vectors
84+
let ports: Vec<Port> = ports.into_iter().collect();
85+
let environment_variables: Vec<EnvVar> = env_vars
86+
.into_iter()
87+
.map(|(name, (default, required, desc))| EnvVar {
88+
name,
89+
default_value: default,
90+
required,
91+
description: desc,
92+
})
93+
.collect();
94+
95+
Ok(ProjectContext {
96+
entry_points,
97+
ports,
98+
environment_variables,
99+
project_type,
100+
build_scripts,
101+
})
102+
}

0 commit comments

Comments
 (0)