Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ensure we do not hit the character limit for deployment name #1474

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

arealmaas
Copy link
Collaborator

@arealmaas arealmaas commented Nov 15, 2024

Description

  • Ensure that we do not hit the character limit for deployment names.
  • Removing unnecessary parts of the name as it is still very much visible what environment this deployment is related to. Mostly for the overview in the image.
  • Improve job name for jobs :meta:. This was not that visible before.

image
image
CleanShot 2024-11-15 at 11 47 21@2x

Related Issue(s)

  • #N/A

Failing workflow: https://github.com/digdir/dialogporten/actions/runs/11854449350/job/33036707915?pr=1473

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Summary by CodeRabbit

  • Chores
    • Simplified deployment naming conventions for migration and application jobs.
    • Organized deployment jobs into three main sections for better clarity.
    • Maintained concurrency management and conditional logic for deployments.

@arealmaas arealmaas requested review from a team as code owners November 15, 2024 10:47
Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the .github/workflows/workflow-deploy-apps.yml file, focusing on simplifying deployment naming conventions and reorganizing job structures. The prefix dp-be-${{ inputs.environment }}- has been removed from deployment names, leading to a clearer format. The workflow is structured into three sections: deploy-migration-job, deploy-apps, and deploy-jobs, with conditional execution and matrix strategies for deployments. Comments clarifying concurrency and job execution behavior have been retained, ensuring clarity and consistency throughout the deployment process.

Changes

File Path Change Summary
.github/workflows/workflow-deploy-apps.yml - Updated job names for deploy-migration-job, deploy-apps, and deploy-jobs to remove unnecessary prefixes.
- Simplified deployment names by removing the prefix from migration and application jobs.
- Organized jobs into three main sections with conditional execution and matrix strategies.
- Retained comments for clarity on concurrency and job execution.

Possibly related PRs

Suggested reviewers

  • oskogstad: Suggested reviewer for this pull request.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 193b764 and aa85d25.

📒 Files selected for processing (1)
  • .github/workflows/workflow-deploy-apps.yml (7 hunks)
🔇 Additional comments (3)
.github/workflows/workflow-deploy-apps.yml (3)

274-274: LGTM: Consistent naming convention across job deployments

The deployment names for background jobs follow the same simplified pattern, maintaining consistency across all deployment types.

Also applies to: 296-296


232-232: LGTM: Improved job name clarity

The updated job name Deploy job ${{ matrix.name }} to ${{ inputs.environment }} provides better visibility by explicitly indicating that this is a job deployment.


88-88: LGTM: Deployment name simplified while maintaining uniqueness

The removal of the redundant prefix dp-be-${{ inputs.environment }}- from the migration job deployment name helps reduce the character count while maintaining uniqueness through the version identifier.

Let's verify the maximum character length:

Also applies to: 109-109

✅ Verification successful

✅ Deployment name length is within Azure's limit

The new deployment name format web-api-migration-job-${{ inputs.version }} has a maximum length of 37 characters (including a typical version string like "v1.2.3-beta.4"), which is well within Azure's 64-character limit for deployment names. The removal of the prefix has successfully reduced the character count while maintaining a clear, descriptive name.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the maximum possible length of deployment names
# Azure has a limit of 64 characters for deployment names

# Test the longest possible deployment name
echo "web-api-migration-job-" > temp.txt
# Add a typical version string (e.g., v1.2.3-beta.4)
echo "v1.2.3-beta.4" >> temp.txt
# Calculate total length
wc -c < temp.txt
rm temp.txt

Length of output: 75

.github/workflows/workflow-deploy-apps.yml Show resolved Hide resolved
@arealmaas arealmaas merged commit e87a375 into main Nov 15, 2024
25 checks passed
@arealmaas arealmaas deleted the ci/ensure-trimmed-names branch November 15, 2024 10:57
@coderabbitai coderabbitai bot mentioned this pull request Dec 11, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants