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

Fix scm resource initialization #700

Merged
merged 6 commits into from
May 22, 2022
Merged

Fix scm resource initialization #700

merged 6 commits into from
May 22, 2022

Conversation

olblak
Copy link
Member

@olblak olblak commented May 21, 2022

Signed-off-by: Olblak me@olblak.com

Fix scm resource initialization

Fix #699

The code base evolved in a situation where scm.Init was called in different places. That led to have some variable not set in some cases. Instead I move that logic in the New function that create SCM spec. I also fix a configuration bug where we couldn't configure GitHub commit behavior.

In summary:

  • Fix git/github scm initialization
  • Add comment on git spec and GitHub spec to generate description in Jsonschema
  • Expose commit configuration for GitHub SCM resource

Test

To test this pull request, you can run the following commands:

./bin/updatecli diff --config e2e/updatecli.d/success.d/source --values e2e/values.yaml --debug --clean=false 
ls /tmp/updatecli/github_com_updatecli_updatecli_git

Additional Information

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added bug Something isn't working scm-git SCM of kind "Git" labels May 21, 2022
@olblak olblak changed the title Refactor scm.Init to remove it Fix scm initialization May 21, 2022
@olblak olblak changed the title Fix scm initialization Cleanup scm initialization May 21, 2022
Remove useless git version from scm git spec

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the scm-github SCM of type GiHhub label May 22, 2022
@olblak olblak changed the title Cleanup scm initialization Fix scm resource initialization May 22, 2022
@olblak olblak merged commit c1030ad into updatecli:main May 22, 2022
@olblak olblak deleted the issues/699 branch May 22, 2022 19:12
@dduportal
Copy link
Contributor

This PR breaks all the manifests in https://github.com/jenkins-infra/kubernetes-management/tree/main/updatecli.

For example:

$ updatecli-next --debug diff --values updatecli/values.yaml --config updatecli/updatecli.d/charts/prometheus.yaml


+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "updatecli/updatecli.d/charts/prometheus.yaml"

SCM repository retrieved: 1
DEBUG: stage: git-clone

DEBUG: cloning git repository: https://github.com/jenkins-infra/kubernetes-management.git in /var/folders/2s/09szbrgn22l2tcvxz1_k34g40000gn/T/updatecli/jenkins-infra/kubernetes-management
Enumerating objects: 14266, done.
Counting objects: 100% (507/507), done.
Compressing objects: 100% (311/311), done.
Total 14266 (delta 400), reused 296 (delta 196), pack-reused 13759
fetching remote branchesEnumerating objects: 10834, done.
Counting objects: 100% (10834/10834), done.
Compressing objects: 100% (6223/6223), done.
Total 10834 (delta 8595), reused 6459 (delta 4606), pack-reused 0


++++++++++++
+ PIPELINE +
++++++++++++



######################################
# BUMP PROMETHEUS HELM CHART VERSION #
######################################


SOURCES
=======

lastChartVersion
----------------
✔ Helm Chart 'prometheus' version '15.10.1' is found from repository https://prometheus-community.github.io/helm-charts

Remark: We couldn't identify a way to automatically retrieve changelog information.
Please use following information to take informed decision

Helm Chart: prometheus
Prometheus is a monitoring system and time series database.
Project Home: https://prometheus.io/

Version created on the 2022-06-12 07:52:28.669763168 &#43;0000 UTC

Sources:

* https://github.com/prometheus/alertmanager

* https://github.com/prometheus/prometheus

* https://github.com/prometheus/pushgateway

* https://github.com/prometheus/node_exporter

* https://github.com/kubernetes/kube-state-metrics



URL:

* https://github.com/prometheus-community/helm-charts/releases/download/prometheus-15.10.1/prometheus-15.10.1.tgz




CHANGELOG:
----------

Remark: We couldn't identify a way to automatically retrieve changelog information.
Please use following information to take informed decision

Helm Chart: prometheus
Prometheus is a monitoring system and time series database.
Project Home: https://prometheus.io/

Version created on the 2022-06-12 07:52:28.669763168 &#43;0000 UTC

Sources:

* https://github.com/prometheus/alertmanager

* https://github.com/prometheus/prometheus

* https://github.com/prometheus/pushgateway

* https://github.com/prometheus/node_exporter

* https://github.com/kubernetes/kube-state-metrics



URL:

* https://github.com/prometheus-community/helm-charts/releases/download/prometheus-15.10.1/prometheus-15.10.1.tgz





TARGETS
========

updateChartVersion
------------------

**Dry Run enabled**

DEBUG: stage: git-checkout

DEBUG: checkout branch "", based on "main" to directory "/var/folders/2s/09szbrgn22l2tcvxz1_k34g40000gn/T/updatecli/jenkins-infra/kubernetes-management"
DEBUG: branch '' doesn't exist, creating it from branch 'main'
DEBUG: branch "" successfully created

ERROR: something went wrong in target "updateChartVersion" : "open /var/folders/2s/09szbrgn22l2tcvxz1_k34g40000gn/T/updatecli/jenkins-infra/kubernetes-management/.git/refs/heads: is a directory"

Pipeline "Bump prometheus helm chart version" failed
Skipping due to:
        targets stage:  "something went wrong during target execution"

=============================

REPORTS:


✗ PROMETHEUS.YAML:
        Sources:
                ✔ [lastChartVersion]  (kind: helmchart)
        Target:
                ✗ [updateChartVersion] stable/prometheus Helm Chart (kind: file)



Run Summary
===========
Pipeline(s) run:
  * Changed:    0
  * Failed:     1
  * Skipped:    0
  * Succeeded:  0
  * Total:      1
ERROR: ✗ 1 over 1 pipeline failed
ERROR: command failed

Sounds like that some initialization paths for GitHub broke

@dduportal
Copy link
Contributor

Fixed in #717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scm-git SCM of kind "Git" scm-github SCM of type GiHhub
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git scm cannot clone git repositories
2 participants