code-review

Schnelle Überprüfungsliste für Python- und Scala-Codeänderungen, bevor diese als abgeschlossen betrachtet werden.

npx skills add https://github.com/microsoft/synapseml --skill code-review

Code Review

Use this skill when reviewing SynapseML changes.

Steps

  1. Inspect diff: git --no-pager diff --stat && git --no-pager diff
  2. Run Scala style: sbt scalastyle test:scalastyle
  3. Run Python format check: black --check --extend-exclude 'docs/' .
  4. Run targeted tests for touched code.
  5. Apply the checklists below to every changed file.
  6. Report only concrete issues with file paths and fixes.

Security Checklist

Apply when changes touch serialization, I/O, network, or authentication code.

Deserialization (CWE-502)

  • No raw ObjectInputStream.readObject(): use SafeObjectInputStream with an allowlist
  • resolveClass allowlist validates array component types. Never allowlist the [ prefix directly; array handling must extract and validate the component class name
  • resolveProxyClass is overridden to block or validate dynamic proxy interfaces
  • Allowlist uses package-prefix matching, not blocklisting
  • Allowlist presets contain no catch-all entries that bypass the filtering logic

Input Validation

  • File paths, URLs, and user-supplied strings are validated before use
  • No unsanitized string interpolation into SQL, shell commands, or config

Resource Management

  • Streams, connections, and closeable resources use using() or try-finally
  • Cleanup runs even when assertions or exceptions are thrown (especially in tests)

Secrets & Credentials

  • No hardcoded secrets, tokens, or passwords in source or test code
  • Credentials loaded from environment variables or secure config only

API Compatibility Checklist

Apply when changes modify public classes, traits, or companion objects.

Binary Compatibility (JVM)

  • No method signature changes on existing public methods (default parameters generate synthetic bridges; use explicit overloads instead)
  • No removed or renamed public classes, traits, or objects
  • Companion object extends DefaultParamsReadable[T] preserved if it existed

Source Compatibility

  • New parameters have defaults so existing callers compile unchanged
  • No narrowed return types or widened parameter types on public methods
  • Import changes don't break wildcard imports in downstream code

Scala Checklist

  • License header present (enforced by scalastyle)
  • Wrappable trait mixed in if the class needs a Python wrapper
  • SynapseMLLogging trait mixed in; logClass() called in constructor
  • No wildcard imports where explicit imports suffice (java.io._ → named imports)
  • No RDD API usage. Use DataFrame/Dataset only
  • Lines ≤ 120 chars, files ≤ 800 lines

Python Checklist

  • License header present
  • Formatted with black==22.3.0
  • No edits to files under target/ (auto-generated)
  • Hand-written overrides in src/main/python/ extend the generated _ClassName

Test Checklist

  • New functionality has corresponding tests
  • Tests use using() for resource cleanup (no bare .close() after assertions)
  • Negative tests verify rejection/error cases, not just happy paths
  • No test-only dependencies leaked into main scope

Mehr Skills von microsoft

oss-growth
microsoft
OSS-Wachstums-Hacker-Persona
agent-framework-azure-ai-py
microsoft
Erstellen Sie Azure AI Foundry-Agents mit dem Microsoft Agent Framework Python SDK (agent-framework-azure-ai). Verwenden Sie dies beim Erstellen persistenter Agents mit AzureAIAgentsProvider, bei der Nutzung gehosteter Tools (Code-Interpreter, Dateisuche, Websuche), bei der Integration von MCP-Servern, bei der Verwaltung von Konversationsthreads oder bei der Implementierung von Streaming-Antworten. Umfasst Funktionstools, strukturierte Ausgaben und Multi-Tool-Agents.
development
airunway-aks-setup
microsoft
Set up AI Runway on AKS — from bare cluster to running model. Covers cluster verification, controller install, GPU assessment, provider setup, and first deployment. WHEN: "setup AI Runway", "onboard AKS cluster", "install AI Runway", "airunway setup", "deploy model to AKS", "GPU inference on AKS", "KAITO setup on AKS", "run LLM on AKS", "vLLM on AKS", "set up model serving on AKS", "AI Runway controller".
devops
appinsights-instrumentation
microsoft
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
devops
applicationinsights-web-ts
microsoft
Instrumentieren Sie Browser-/Web-Apps mit dem Application Insights JavaScript SDK (@microsoft/applicationinsights-web). Verwenden Sie es für Real User Monitoring (RUM) – Seitenaufrufe, Klicks, AJAX/Fetch-Abhängigkeiten, Ausnahmen, benutzerdefinierte Ereignisse und browser-seitige GenAI-Agent-Traces, die mit Backend-OpenTelemetry-Traces korreliert werden. Umfasst SDK-Loader-Skript und npm-Setup, Framework-Erweiterungen (React, React Native, Angular), Click Analytics, Telemetrie-Initialisierer und OTel-GenAI-Semantik-Konventionen für Agent-/Tool-/Modell-Spans, die vom Browser ausgegeben werden.
devops
azure-ai-anomalydetector-java
microsoft
Erstellen Sie Anomalieerkennungsanwendungen mit dem Azure AI Anomaly Detector SDK für Java. Verwenden Sie dies bei der Implementierung von univariater/multivariater Anomalieerkennung, Zeitreihenanalyse oder KI-gestützter Überwachung.
development
azure-ai-language-conversations-py
microsoft
Implementieren Sie Conversational Language Understanding (CLU) mit dem azure-ai-language-conversations Python SDK. Verwenden Sie dies, wenn Sie mit ConversationAnalysisClient arbeiten, um Gesprächsabsichten und Entitäten zu analysieren, NLP-Funktionen zu erstellen oder Sprachverständnis in Anwendungen zu integrieren.
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 für Python. Verwenden für ML-Workspaces, Jobs, Modelle, Datensätze, Compute und Pipelines. Auslöser: „azure-ai-ml“, „MLClient“, „Workspace“, „Modell-Registry“, „Trainings-Jobs“, „Datensätze“.
development