GithubHelp home page GithubHelp logo

azure-devops-templates's People

Contributors

ahockersten avatar bittrance avatar calleb3 avatar dachrillz avatar dunklas avatar hagej avatar jimgus avatar nissessenap avatar phillebaba avatar simongottschlag avatar ulrikstrid avatar versa78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

azure-devops-templates's Issues

Race condition when running multple CD at the same time

Working in monorepos we sometimes make changes to multiple services at the same time (backend and frontend as an example). This triggers multiple CD runs at approximately the same time and then we get errors in git because we're trying to push when we're not at the latest master.

The fix is to do a git pull --rebase just before we push so that we're on the latest at the time of pushing. We could also catch any error while pushing and try to do this only then.

github action cronjob fail missing access

Get the following error when running the sync cronjob for cloning github actions.
This is due to low access.
Need to give the account access to workflows we also need to document what needs to be configured in this repo.

Already on 'main'
Your branch is up to date with 'origin/main'.
From https://github.com/XenitAB/azure-devops-templates

Skip stages if not tagged

When commiting to master (non-tagged), all stages will "run" (be green) but only a dev will run the jobs and the others (qa/prod) will be skipped.

When you add an approval to the prod environment, it will always stop there even if not a tagged release and you need to approve it before it can be "skipped".

gitops-v2: dockerLint ignoreRuleViolations set to false causes error

Job image: Step specifies condition and(succeeded(), eq(, true), eq(variables['Build.sourceBranch'], 'refs/heads/master')) which is not valid. Reason: Unexpected symbol: ','. Located at position 21 within expression: and(succeeded(), eq(, true), eq(variables['Build.sourceBranch'], 'refs/heads/master')).

Increase logging for detecting changes in azure-devops-template

In a pipeline I got the below error.

  ------------------------------------------
  disk i/o             8.274747ms
  parsing HCL          54µs
  evaluating values    4.889227ms
  running checks       2.784716ms

  counts
  ------------------------------------------
  files loaded         11
  blocks               92
  evaluated blocks     92
  modules              0
  module blocks        0

No problems detected!

run make validate and commit changes
##[error]Script failed with error: Error: The process '/bin/bash' failed with exit code 1

This is due to the user removed .terraform.lock.hcl by mistake so when the validation pipeline run:s and we then check if anything have changed we can't see any error because of we don't visualize none index files.
To make the error more visible we need to update in:

if [[ $(git status --porcelain) ]]; then
git diff
echo 'run make validate and commit changes' 1>&2
exit 1

Tags doesn't always work in monorepos

When using this for a monorepo it's not unlikely there will be commits to other services between a push and a tag, this then breaks when we check for the commit hash since we're using Build.SourceVersion which just checks the latest hash that triggered the build.

We need a different way of finding the hash, either by looking at previous pipeline runs for the service or by looking at the dev yaml.

PR validation

How should PR validation / PR triggers be handled?

Build errors in terraform tenant pipeline

I can't see this error in our XKS pipelines but for one tenant I can see it.
When I run make locally on my computer it works without any issues.

Digest: sha256:5ee2e1d098e1228e7c49387b9cf570f567b662237ba289a11b7d926fcc1d1849
Status: Downloaded newer image for ghcr.io/xenitab/github-actions/tools:2022.10.1
[Errno 13] Permission denied: '/work/.azure/versionCheck.json'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/cloud.py", line 474, in get_active_cloud_name
    return cli_ctx.config.get('cloud', 'name')
  File "/opt/az/lib/python3.10/site-packages/knack/config.py", line 99, in get
    raise last_ex  # pylint:disable=raising-bad-type
  File "/opt/az/lib/python3.10/site-packages/knack/config.py", line 94, in get
    return config.get(section, option)
  File "/opt/az/lib/python3.10/site-packages/knack/config.py", line 208, in get
    return self.config_parser.get(section, option)
  File "/opt/az/lib/python3.10/configparser.py", line 782, in get
    d = self._unify_values(section, vars)
  File "/opt/az/lib/python3.10/configparser.py", line 1153, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'cloud'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/az/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/__main__.py", line 38, in <module>
    az_cli = get_default_cli()
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/__init__.py", line 910, in get_default_cli
    return AzCli(cli_name='az',
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/__init__.py", line 86, in __init__
    self.cloud = get_active_cloud(self)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/cloud.py", line 555, in get_active_cloud
    return get_cloud(cli_ctx, get_active_cloud_name(cli_ctx))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/cloud.py", line 477, in get_active_cloud_name
    _set_active_cloud(cli_ctx, default_cloud_name)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/cloud.py", line 468, in _set_active_cloud
    cli_ctx.config.set_value('cloud', 'name', cloud_name)
  File "/opt/az/lib/python3.10/site-packages/knack/config.py", line 161, in set_value

Could the following be something to look in to?

https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest#cli-configuration-file

environment {
    AZURE_CONFIG_DIR = "${env.WORKSPACE}/.azure"
}

Skip flux status check if image tag hasn't changed but gitops has

Reproduce using the following steps:

  • Commit to master for service
  • CI / CD runs fine
  • Tag service
  • CI / CD runs fine
  • Update gitops repo (change CD reference tag for example)
  • Manually run CD
  • Push validation will go through
  • Image tag won't be changed
  • flux-status-cli will check for status of the latest gitops commit which will never be updated by flux-status

azdo new imported pipeline breaking "pathspec 'main' did not match any file(s) known to git"

For smoe reason when importing this repo to azure devops and run the pipeline I'm getting the following error.
I ran the pipeline multiple times and still the same issue.
It's probably something simple but I don't understand why.

image

I have also recreated this in a known working environment with a new repo and I get the same issue.
But the pipeline work in old repos.

Create CI pipeline for gitops repos that check yaml correctness

Today it's up to the developers to write correct yaml out of the box and the code reviewer have to see that it's correct or clone down the repo and build the yaml on there own.

Implement a simple kustomize build check to see that can at least be built.
It would also be nice to have rego to check for some best practices.
We could also do some general linting of the yaml files.

and probably many more solutions but this is a start.

githubaction push image slow

For some reason the push image takes allot of time when running github actions.

This should only take a few seconds to download and push the image but instead it almost takes a minute.
It's possible that we get a new server between the build and the push but even so it takes a long time.
Compare it to how azure devops times and do some testing around it and see if we can come up with why it takes so long time.

image

The size in this example is about 141 MB

image

This example the size is 104 Mb.

It might be that github:s artifacts storage is just slow...

https://github.com/XenitAB/azure-devops-templates/tree/main/gitops-v2-github

https://github.com/XenitAB/azure-devops-templates/blob/main/.github/workflows/push-image-acr.yaml

Reccomended way to deal with globally setting version

When there are multiple repositories all using these templates, they will all reference the version used individually. This will result in a lot of manual work when updating the version. We need to publish a best practice guide for how to avoid this work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.