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: controller crash when provenance is set only on the global repo #1742

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

savitaashture
Copy link
Member

This commit fixes the controller crash by adding
a nil pointer check before accessing the elements of an object. Issue: https://issues.redhat.com/browse/SRVKP-5571

Verification:

Created Global Repo like below

apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:  
  name: pipelines-as-code  
  namespace: openshift-pipelines
spec:  
  settings:    
    pipelinerun_provenance: "default_branch"

created local Repo like below

apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:  
  name: test  
  namespace: test
spec:  
  settings: {}
  url: https://github.com/savitaashture/test-pac

Signed-off-by: Savita Ashture [email protected]

Changes

Submitter Checklist

  • 📝 Please ensure your commit message is clear and informative. For guidance on crafting effective commit messages, refer to the How to write a git commit message guide. We prefer the commit message to be included in the PR body itself rather than a link to an external website (ie: Jira ticket).

  • ♽ Before submitting a PR, run make test lint to avoid unnecessary CI processing. For an even more efficient workflow, consider installing pre-commit and running pre-commit install in the root of this repository.

  • ✨ We use linters to maintain clean and consistent code. Please ensure you've run make lint before submitting a PR. Some linters offer a --fix mode, which can be executed with the command make fix-linters (ensure markdownlint and golangci-lint tools are installed first).

  • 📖 If you're introducing a user-facing feature or changing existing behavior, please ensure it's properly documented.

  • 🧪 While 100% coverage isn't a requirement, we encourage unit tests for any code changes where possible.

  • 🎁 If feasible, please check if an end-to-end test can be added. See README for more details.

  • 🔎 If there's any flakiness in the CI tests, don't necessarily ignore it. It's better to address the issue before merging, or provide a valid reason to bypass it if fixing isn't possible (e.g., token rate limitations).

@savitaashture savitaashture requested review from enarha and zakisk and removed request for enarha and zakisk July 23, 2024 17:42
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.63%. Comparing base (9ca0a1a) to head (ca4fc85).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1742      +/-   ##
==========================================
+ Coverage   64.61%   64.63%   +0.01%     
==========================================
  Files         146      146              
  Lines       11271    11271              
==========================================
+ Hits         7283     7285       +2     
+ Misses       3456     3454       -2     
  Partials      532      532              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@enarha
Copy link
Contributor

enarha commented Jul 24, 2024

/lgtm

@savitaashture savitaashture changed the title [WIP] fix: controller crash when provenance is set only on the global repo fix: controller crash when provenance is set only on the global repo Jul 25, 2024
@savitaashture
Copy link
Member Author

savitaashture commented Jul 25, 2024

I have corrected e2e

But why linter is failing i need to check

@savitaashture
Copy link
Member Author

/test linters

@savitaashture
Copy link
Member Author

@zakisk @enarha CI is green
PTAL Thank you

savitaashture and others added 2 commits July 26, 2024 22:12
This commit fixes the controller crash by adding
a nil pointer check before accessing the elements of an object.
Issue: https://issues.redhat.com/browse/SRVKP-5571

Signed-off-by: Savita Ashture <[email protected]>
This will fix vale config file to compatible with latest version as
it was throwing error that IgnoredScopes and SkippedScopes to be
defined before syntx options
@enarha
Copy link
Contributor

enarha commented Jul 29, 2024

I like it better with the updated test. Thanks.

@savitaashture
Copy link
Member Author

/test go-testing

@savitaashture savitaashture merged commit 7c9970d into openshift-pipelines:main Jul 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants