Open
Conversation
test: fixed cli test broken by #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GLITCH 2.0.0 Release Notes
This major release introduces significant new features, including an interactive repair system (Infrafix), a Rego policy engine for smell detection, and extensive improvements to all parsers and the intermediate representation.
Highlights
New Features
Interactive Repair (Infrafix)
A new CLI subcommand
glitch infrafixenables interactive repair of IaC scripts using constraint solving with Z3.Usage:
Components:
glitch/repair/interactive/main.py- Orchestration layer for the repair workflowglitch/repair/interactive/solver.py- Z3-based constraint solver for patch generationglitch/repair/interactive/compiler/- DeltaP compiler for translating IR to constraintsglitch/repair/interactive/tracer/- System call tracer for runtime analysisglitch/repair/interactive/llm_solver.py- LLM integration for repair suggestionsCapabilities:
Rego Policy Engine Integration
Smell detection can now be performed using Rego queries, enabling declarative policy-based analysis.
New Components:
glitch/rego/engine.py- Bridge between Rego engine and GLITCH analysis pipelineglitch/rego/rego_python/- Python wrapper for the Go-based Rego libraryglitch/rego/queries/- Rego query files for smell detectionDesign Smell Queries (6):
design_avoid_comments.regodesign_imperative_abstraction.regodesign_long_resource.regodesign_misplaced_attribute.regodesign_multifaceted_abstraction.regoimplementation_too_many_variables.regoSecurity Smell Queries (13):
sec_def_admin.regosec_empty_pass.regosec_full_permission_filesystem.regosec_hard_pass.regosec_hard_secr.regosec_hard_user.regosec_https.regosec_invalid_bind.regosec_no_default_switch.regosec_no_int_check.regosec_obsolete_command.regosec_susp_comm.regosec_weak_crypt.regoRego Library:
glitch/rego/queries/library/glitch_lib.rego- Shared helper functions for Rego queriesInstallation:
Pre-built binaries are available for Linux, macOS, and Windows. See README.md for download links and build instructions.
Parser Improvements
Ansible Parser (
glitch/parsers/ansible.py)becomedirectiveset_factmoduleChef Parser (
glitch/parsers/chef.py)brace_blockandmethod_add_blockconstructsdoblocks inside atomic unitscasestatement parsing with proper line trackingAddArgsconstructPuppet Parser (
glitch/parsers/puppet.py)$prefix for variable referencesTerraform Parser (
glitch/parsers/terraform.py)localsblocksGitHub Actions Parser (
glitch/parsers/gha.py)Intermediate Representation Enhancements
New Expression Types
Undef- Represents undefined valuesAddArgs- Ruby additional arguments constructBlockExpr- Block expressionsEnhanced
ElementInfoAll IR elements now include comprehensive position information:
line- Starting line numbercolumn- Starting column numberend_line- Ending line numberend_column- Ending column numberUnitBlockImprovementsnum_linesfield to track file line counts (needed for Rego analysis)as_dict()serialization for Rego compatibility__repr__for atomic unitsNew Constructs
ConditionalStatementnow includesis_topflagKeyValuepairs in hash structuresFunctionCallwith anonymous function supportTest Suite Reorganization
Tests have been moved from
glitch/tests/to project roottests/:CI/CD Improvements
New Workflows
.github/workflows/rego_python.yml)Updated Workflows
.github/workflows/lint.yml)Breaking Changes
Configuration Changes
glitch/configs/default.jsonfor Rego configurationglitch/configs/terraform.iniwith new smell definitionsAPI Changes
glitch lint,glitch repr,glitch infrafixDependencies
New Dependencies
z3-solver(^4.12.4.0) - Constraint solver for interactive repairtyping-extensions(^4.12.2) - Extended typing supportpyright(1.1.408) - Static type checkingUpdated Dependencies
pandasupdated to 2.3.3puppetparserupdated to 0.2.14Custom Dependencies
Jinja2- Using fork with token location supportpython-hcl2- Using branch with HCL2 reverse transformerConfiguration
Type Checking
Strict type checking is now enforced via pyright:
New Stubs
stubs/z3.pyifor Z3 solverstubs/ruamel/yaml/nodes.pyiMigration Guide
For CLI Users
For Rego Users
glitch/rego/rego_python/src/rego_python/bin/python -c "from glitch.rego.rego_python.src.rego_python import run_rego; print('OK')"Contributors
Thanks to all contributors who made this release possible.
Full Changelog
For the complete list of changes, see the commit history.