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

Mage_Report: Migrated hardcoded cron expressions to configurable fields #1869

Merged
merged 14 commits into from
Jul 12, 2023

Conversation

Sekiphp
Copy link
Contributor

@Sekiphp Sekiphp commented Oct 22, 2021

Description (*)

Replaced hardcoded cron expressions to system configurable with same default values. Please, see the image below:
image

Related Pull Requests

#1829

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added Component: Reports Relates to Mage_Reports Component: Sales Relates to Mage_Sales Component: SalesRule Relates to Mage_SalesRule Component: Tax Relates to Mage_Tax labels Oct 22, 2021
@elidrissidev
Copy link
Member

Nice one!

@midlan midlan added hacktoberfest-accepted work in progress For Pull Requests which still have changes planned labels Oct 22, 2021
@addison74
Copy link
Contributor

This is a very good idea. I totally agree to move the hardcoded values from XML files to Magento Configuration.

The same modification should be done for Price Alerts and other jobs that only run when time is 00:00. At least for Price Alerts is funny to wait 10 - 12 hours till Magento sends the notifications. I posted in Discussion more thoughts about this issue. I fixed it by creating a custom module.

@elidrissidev
Copy link
Member

The related PR is merged, you may now rebase and comment out the other changes

Copy link
Contributor

@luigifab luigifab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the new translations in CSV files?
Can you add a dot at the end of comments?
Can you add in comments the default value?
Edit: since, #2148, can you remove <frontend_type>text</frontend_type> for added configuration?

@fballiano fballiano force-pushed the mage-reports/cron-expr-configurable branch from d815035 to 7a97c01 Compare June 8, 2022 20:23
@fballiano
Copy link
Contributor

The related PR is merged, you may now rebase and comment out the other changes

rebased

@addison74
Copy link
Contributor

I would revise the labels and comments for this PR. @luigifab also requested a few good changes.

Once we agree the labels and comments we can add the translation phrases.

@fballiano
Copy link
Contributor

I've removed the frontend_type and uncommented the commented part of the xml

@fballiano
Copy link
Contributor

Can you add the new translations in CSV files?

This point still has to be done

@addison74
Copy link
Contributor

I'm also waiting for the small change requested from "Cron settings" to "Cron Settings" but I have to insist because it is left to wait..

@fballiano
Copy link
Contributor

I did it for you (you could do it anyway since this PR is modificable)

@addison74
Copy link
Contributor

Indeed, I can create a commit with the change. Good tip.

Before adding new translations, it would be good to discuss their wording. Since we are in a cron setting section I don't think there is a need for "Cron definition -" prefix. Bestsellers is just fine. Maybe the labels under the boxes need to be analyzed, maybe even removed.

@sreichel
Copy link
Contributor

sreichel commented Sep 6, 2022

Can this be merged to 19.x?

@addison74 addison74 self-assigned this Sep 6, 2022
@sreichel sreichel force-pushed the mage-reports/cron-expr-configurable branch from 72fc905 to 6cf2b2e Compare September 12, 2022 23:07
@sreichel
Copy link
Contributor

sreichel commented Sep 12, 2022

I'm to stupid to rebase this. :(

How to change target version for PRs?

@fballiano
Copy link
Contributor

To v19?

@sreichel
Copy link
Contributor

Yes.

@fballiano
Copy link
Contributor

I guess you tries already editing the PR with the github web and broke everything right?

@sreichel
Copy link
Contributor

Tried different things ... last error as i tried to update upstream repo .... [remote rejected] (refusing to allow a Personal Access Token to create or update workflow .github/workflows/static-code-analyses.ymlwithoutworkflow scope)

It would take 2 min to edit 7 files manually ... lol.

@elidrissidev
Copy link
Member

last error as i tried to update upstream repo .... [remote rejected] (refusing to allow a Personal Access Token to create or update workflow .github/workflows/static-code-analyses.ymlwithoutworkflow scope)

Your personal access token is lacking the workflow permission

@fballiano fballiano changed the base branch from 20.0 to main April 4, 2023 17:33
@addison74
Copy link
Contributor

addison74 commented Jul 11, 2023

Sven created another PR here #2595 that had all the changes, but he chose to close it. I allowed myself to make the necessary changes to move forward.

Here you can see the image as it looks in the Backend.

screenshot

In my opinion, it looks fine.

@addison74
Copy link
Contributor

addison74 commented Jul 12, 2023

The interface looks good now. See the screenshot above.

The only issue I would like to discuss before approving is related to the "Most Viewed" field. Shouldn't we set up a default value for it?

From what I can see, it takes the value from this PR #1829, but I think it's better to put a value in the box, similar to the others.

@fballiano
Copy link
Contributor

@addison74 I implemented this change also for the most_viewed report:

Screenshot 2023-07-12 alle 12 10 44

;-)

@addison74
Copy link
Contributor

We can merge this PR, it works as expected.

I changed all values to */2 * * * * in order to run the cron every 2 minutes.

screenshot_1

cron_schedule table has a lot of records like aggregate_

screenshot_2

By reloading the "Refresh Statistics" page on the "Update At" column the time is changing

screenshot_3

@fballiano fballiano changed the title Mage_Report: Migrate hardcoded cron expressions to configurable fields Mage_Report: Migrated hardcoded cron expressions to configurable fields Jul 12, 2023
@fballiano fballiano merged commit 7ee5bf0 into OpenMage:main Jul 12, 2023
@addison74
Copy link
Contributor

Shall we mention for every field in comment the default value 0 0 * * *? I have to take a look in the Backend for similar fields.

@addison74 addison74 removed their assignment Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Reports Relates to Mage_Reports Component: Sales Relates to Mage_Sales Component: SalesRule Relates to Mage_SalesRule Component: Tax Relates to Mage_Tax hacktoberfest-accepted work in progress For Pull Requests which still have changes planned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants