#1950 Fixed Wrong data in heatmap issue #1949
Closed 7 years ago by pingou. Opened 7 years ago by smitthakkar96.
smitthakkar96/pagure heatmap_fix  into  master

file modified
+1
@@ -99,6 +99,7 @@ 

  

  

  def ssh_key_validator(form, field):

+     ''' Form for ssh key validation '''

you have made this change in each and every commit of yours

      if not pagure.lib.are_valid_ssh_keys(field.data):

          raise wtforms.ValidationError('Invalid SSH keys')

  

file modified
+3 -4
@@ -3830,7 +3830,6 @@ 

  

  def log_action(session, action, obj, user_obj):

      ''' Log an user action on a project/issue/PR. '''

- 

i dont think pep8 will accept this :)

      project_id = None

      if obj.isa in ['issue', 'pull-request']:

          project_id = obj.project_id
@@ -3845,9 +3844,9 @@ 

          user_id=user_obj.id,

          project_id=project_id,

          log_type=action,

-         ref_id=obj.id,

-         date=obj.date_created.date(),

-         date_created=obj.date_created

+         ref_id=obj.id

+         # date=obj.date_created.date(),

+         # date_created=obj.date_created

you shall remove these lines instead of commenting them :)

Why do you want to remove them in the first place?

And my question highlights how you commit message needs to be adjusted so that someone understand what it is about without having to actually go and look at this ticket to understand the issue that is being resolved.

      )

      if obj.isa == 'issue':

          setattr(log, 'issue_uid', obj.uid)

We were storing the date of the Issue/PR instead of the time when the issue was created, I modified log_action in init.py to store current datetime.

i dont think pep8 will accept this :)

you have made this change in each and every commit of yours

you shall remove these lines instead of commenting them :)

Why do you want to remove them in the first place?

And my question highlights how you commit message needs to be adjusted so that someone understand what it is about without having to actually go and look at this ticket to understand the issue that is being resolved.

As mentioned inline, the commit message needs to be re-worded to be self explanatory.

In addition, it would be good to have unit-tests for this :)

Ok thanks @pingou I will look into it and try to add tests.

@smitthakkar96 what is the progress on this ?

@farhaan I am travelling so I will need to work on it when I reach home.

@pingou I will reword the commit message but I have removed those two lines as they were the causing the program to store the date of issue when it was created so I removed those lines, now by default the date and time of action will be stored as in models we have set default=datetime.datetime.utcnow() .

@smitthakkar96 I realized this when reading the ticket, and this shows why the commit message needs to be reworded :)

@vivekanand1101 re-did this PR in https://pagure.io/pagure/pull-request/2072 so we could merge it :)

Thank you both!

Pull-Request has been closed by pingou

7 years ago