Skip to content

Add ignore aliaba specs which are not availble#2132

Merged
cb-github-robot merged 3 commits intocloud-barista:mainfrom
seokho-son:main
Sep 2, 2025
Merged

Add ignore aliaba specs which are not availble#2132
cb-github-robot merged 3 commits intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Seokho Son <shsongist@gmail.com>
Signed-off-by: seokho-son <shsongist@gmail.com>
Copilot AI review requested due to automatic review settings September 2, 2025 17:12
@github-actions github-actions bot added the asset label Sep 2, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements functionality to filter and ignore cloud specs that are not available during spec fetching operations. The changes add support for loading ignore patterns from a YAML configuration file and skip processing specs that match these patterns to improve performance and avoid unnecessary API calls.

Key changes:

  • Add cloud spec ignore functionality with YAML configuration support
  • Implement spec filtering based on provider and region-specific patterns
  • Include ignore information in API responses and logging
  • Improve HTTP response body logging with truncation for large responses

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/interface/rest/server/resource/image.go Fix image key decoding logic to handle URL decode failures properly
src/interface/rest/docs/swagger.yaml Add API schema for specs to ignore information
src/interface/rest/docs/swagger.json Add JSON schema definitions for specs ignore data structure
src/interface/rest/docs/docs.go Update generated documentation with new schema definitions
src/core/resource/spec.go Implement core spec filtering logic and ignore pattern matching
src/core/model/spec.go Add data models for ignore configuration and API responses
src/core/common/client/client.go Improve HTTP response logging with better truncation handling
docker-compose.yaml Enable external network access and metabase service
assets/cloudspec_ignore.yaml Add comprehensive ignore patterns configuration for Alibaba Cloud

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 301 to +302
}
log.Debug().Msgf("[Get Image] (nsId: %s, Refined imageKey: %s)", nsId, imageKey)
imageKey = decodedImageKey
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assignment will use an empty string if URL decoding fails, potentially causing incorrect behavior. The original logic correctly preserved the original imageKey when decoding failed. This change could break image retrieval when the imageKey contains URL-encoded characters that fail to decode.

Copilot uses AI. Check for mistakes.
defer func() { <-semaphore }()

common.RandomSleep(0, 10)
common.RandomSleep(0, 20)
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The random sleep duration has been doubled from 10 to 20 seconds without explanation. This change could significantly impact performance by adding unnecessary delays. Consider documenting why this increase is needed or reverting to the original value.

Suggested change
common.RandomSleep(0, 20)
common.RandomSleep(0, 10)

Copilot uses AI. Check for mistakes.
Comment on lines +2772 to +2778
if strings.ToLower(providerName) == "alibaba" {
log.Debug().
Str("provider", providerName).
Int("globalPatterns", len(cspPatterns.GlobalPatterns)).
Interface("globalPatterns", cspPatterns.GlobalPatterns).
Msg("Found CSP-specific patterns for alibaba")
}
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debug logging block is hardcoded specifically for 'alibaba' provider. This creates inconsistent debugging experience for other providers and should either be generalized to all providers or removed if it was temporary debugging code.

Copilot uses AI. Check for mistakes.
Comment on lines +2783 to +2789
if strings.ToLower(providerName) == "alibaba" {
log.Debug().
Str("spec", specName).
Str("pattern", pattern).
Str("provider", providerName).
Msg("Spec matched CSP global ignore pattern")
}
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another hardcoded debug logging block specific to 'alibaba'. These provider-specific debug logs should be generalized or removed to maintain consistent debugging across all cloud providers.

Copilot uses AI. Check for mistakes.
Comment on lines +2799 to +2806
if strings.ToLower(providerName) == "alibaba" {
log.Debug().
Str("spec", specName).
Str("pattern", pattern).
Str("provider", providerName).
Str("region", regionName).
Msg("Spec matched region-specific ignore pattern")
}
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third instance of alibaba-specific debug logging. These conditional debug logs create inconsistent behavior and should be either generalized to work for all providers or removed entirely.

Copilot uses AI. Check for mistakes.
# CSP-specific ignore patterns
csps:
alibaba:
description: "Alibaba Cloud spec ignore patterns - Updated based on real availability data (89.6% deletion rate - Sequential cleanup)"
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title of the PR mentions 'aliaba' but this should be 'alibaba'. Please verify the PR title spelling is correct.

Copilot uses AI. Check for mistakes.
Signed-off-by: seokho-son <shsongist@gmail.com>
@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Sep 2, 2025
@cb-github-robot cb-github-robot merged commit 5741822 into cloud-barista:main Sep 2, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon. asset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants