feat(azuredevops): add environment_pattern for extracting environment names from job/stage names (#8671)

This enhancement addresses the issue where the Azure DevOps plugin was unable to
correctly detect production deployments when the environment name is embedded in
job/stage names rather than being in a standard format.

Changes:
- Add `environment_pattern` scope config field that supports regex capture groups
  to extract environment names from job/stage names
- Collect both Job and Stage records from the timeline API (previously only Job)
- Add `identifier`, `type`, and `parent_id` fields to the Job model
- Update environment detection logic:
  - If environment_pattern is configured, extract the environment name first
  - Apply production_pattern to the extracted environment name
  - Fall back to matching production_pattern against job name if no extraction
- Fix default environment behavior: only default to PRODUCTION when
  production_pattern is not configured (was defaulting PRODUCTION always)
- Add comprehensive tests for the new functionality

Example configuration for pipelines with jobs like 'deploy_xxxx-prod_helm':
- deployment_pattern: deploy
- production_pattern: prod
- environment_pattern: (?:deploy|predeploy)[_-](.+?)(?:[_-](?:helm|terraform))?$

This extracts 'xxxx-prod' from the job name and then applies production_pattern
to correctly identify it as a production deployment.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
4 files changed
tree: 35a0d88551af54a6293a66ed31ede786744e6d37
  1. .devcontainer/
  2. .github/
  3. backend/
  4. config-ui/
  5. devops/
  6. grafana/
  7. resources/
  8. .asf.yaml
  9. .dockerignore
  10. .editorconfig
  11. .gitattributes
  12. .gitignore
  13. .licenserc.yaml
  14. AGENTS.md
  15. DISCLAIMER
  16. docker-compose-dev.yml
  17. docker-compose.datasources.yml
  18. env.example
  19. LICENSE
  20. Makefile
  21. NOTICE
  22. README.md
README.md

Apache DevLake(Incubating)

PRs Welcome Dockerhub pulls unit-test Go Report Card Slack Twitter

🤔 What is Apache DevLake?

Apache DevLake is an open-source dev data platform that ingests, analyzes, and visualizes the fragmented data from DevOps tools to extract insights for engineering excellence, developer experience, and community growth.

Apache DevLake is used by Engineering Leads, Open Source Software Maintainers and development teams looking to make better sense of their development process and to bring a more data-driven approach to their own practices. You can ask Apache DevLake many questions regarding your development process. Just connect and query.

🎯 What can be accomplished with Apache DevLake?

  1. Your Dev Data lives in many silos and tools. DevLake brings them all together to give you a complete view of your Software Development Life Cycle (SDLC).
  2. From DORA to scrum retros, DevLake implements metrics effortlessly with prebuilt dashboards supporting common frameworks and goals.
  3. DevLake fits teams of all shapes and sizes, and can be readily extended to support new data sources, metrics, and dashboards, with a flexible framework for data collection and transformation.

👉 Live Demos

The main way you interact with DevLake is through the integrated dashboards powered by Grafana.

Live DORA Dashboard

Dashboards for Engineering Leads

Dashboards for OSS Maintainers

💪 Supported Data Sources

DevLake supports connections to many popular development tools, including GitHub, GitLab, Jenkins, Jira, Sonarqube and more. Here you can find all data sources supported by DevLake, their scopes, supported versions and more!

🚀 Getting Started

Installation

You can set up Apache DevLake by following our step-by-step instructions for either Docker Compose or Helm. Feel free to ask the community if you get stuck at any point.

🤓 Usage

Please see detailed usage instructions. Here's an overview on how to get started using DevLake.

1. Set up DevLake

Install using either Docker Compose or Helm.

2. Create a Blueprint

The DevLake Configuration UI will guide you through the process (a Blueprint) to define the data connections, data scope, transformation and sync frequency of the data you wish to collect.

3. Track the Blueprint's progress

You can track the progress of the Blueprint you have just set up.

4. View the pre-built dashboards

Once the first run of the Blueprint is completed, you can view the corresponding dashboards.

5. Customize the dashboards with SQL

If the pre-built dashboards are limited for your use cases, you can always customize or create your own metrics or dashboards with SQL.

Contributing

Please read the contribution guidelines before you make contribution. The following docs list the resources you might need to know after you decided to make contribution.

👩🏾‍💻 Contributing Code

If you plan to contribute code to Apache DevLake, we have instructions on how to get started with setting up your Development environemtn.

📄 Contributing Documentation

One of the best ways to get started contributing is by improving DevLake's documentation.

⌚ Roadmap

  • Roadmap: Detailed roadmaps for DevLake.

💙 Community

Message us on Slack

📄 License

This project is licensed under Apache License 2.0 - see the LICENSE file for details.