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

Push rule diff fails on unknown original value #223

Closed
seboudry opened this issue May 27, 2021 · 2 comments
Closed

Push rule diff fails on unknown original value #223

seboudry opened this issue May 27, 2021 · 2 comments
Labels

Comments

@seboudry
Copy link

On some projects, dry-run push rules fails.
The error came from ??? value but don't know why original value can't be retrieve on some projects.

GitLabForm version: 2.0.0.post1 
config_version: 2

projects_and_groups:

  "my-group/*":
    project_push_rules:
      commit_committer_check: true
      member_check: true

On some projects, I got this error:

Processing project_push_rules in dry-run mode.
Warning: Error occurred while processing project my-group/my-project, exception:
'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/gitlabform/gitlabform/gitlabform/core.py", line 548, in process_all
    self.project_processors.process_project(
  File "/gitlabform/gitlabform/gitlabform/processors/project/__init__.py", line 63, in process_project
    processor.process(project_and_group, configuration, dry_run, output_file)
  File "/gitlabform/gitlabform/gitlabform/processors/util/decorators.py", line 42, in method_wrapper
    return method(self, project_and_group, SafeDict(configuration), *args)
  File "/gitlabform/gitlabform/gitlabform/processors/abstract_processor.py", line 41, in process
    self._print_diff(
  File "/gitlabform/gitlabform/gitlabform/processors/project/project_push_rules_processor.py", line 32, in _print_diff
    DifferenceLogger.log_diff(
  File "/gitlabform/gitlabform/gitlabform/processors/util/difference_logger.py", line 21, in log_diff
    changes = [
  File "/gitlabform/gitlabform/gitlabform/processors/util/difference_logger.py", line 22, in <listcomp>
    [k, json.dumps(current_config.get(k, "???")), json.dumps(v)]
AttributeError: 'NoneType' object has no attribute 'get'
@robin-moss
Copy link

This seems to only be related to Require expression in commit messages. I have a setup that uses:

  • Require expression in commit messages
  • Branch name
  • Commit author's email

The job fails when the Require expression in commit messages is blank, but not the others

@gdubicki
Copy link
Member

gdubicki commented Jun 6, 2021

Thanks for reporting this!

It should be fixed in v2.0.3 which has just been released. Please reopen if you are still seeing this after updating GitLabForm.

@gdubicki gdubicki closed this as completed Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants