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

Separate Statistics per Organization #3663

Merged
merged 5 commits into from
Jan 24, 2019
Merged

Separate Statistics per Organization #3663

merged 5 commits into from
Jan 24, 2019

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Jan 22, 2019

Steps to test:

  • create a second organization
  • create some projects, tasks, trace some
  • check if statistics page values match each organization’s expected values

Issues:


@fm3 fm3 requested review from youri-k and jstriebel January 22, 2019 12:59
@fm3 fm3 self-assigned this Jan 22, 2019
@fm3 fm3 added the backend label Jan 22, 2019
notdel(r) && (r.created >= new java.sql.Timestamp(start.getOrElse(0))) && r.created <= new java.sql.Timestamp(
end.getOrElse(MAX_TIMESTAMP)))
.result)
r <- run(sql"""select #${columnsWithPrefix("t.")} from #${existingCollectionName} t
Copy link
Contributor

@jstriebel jstriebel Jan 23, 2019

Choose a reason for hiding this comment

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

I'm wondering why we can't use the scala slick syntax here. Or do you simply prefer SQL?

Copy link
Member Author

Choose a reason for hiding this comment

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

In my first draft, I was going to use the accessQueries to find all items in the visible scope of the requesting user, rather than filter by organization (that would have required sql syntax). However, it turned out that leads to inconsistencies e.g. with public datasets. So I changed course, but I didn’t change this code back to slick syntax.

However, I think the more complex the query, the easier to write and read is SQL compared to slick syntax. Since we introduced a join here, I’d keep this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine with me 👍

Copy link
Contributor

@jstriebel jstriebel left a comment

Choose a reason for hiding this comment

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

LGTM 👍 didn't test it, though

@fm3 fm3 merged commit 60119c8 into master Jan 24, 2019
@fm3 fm3 deleted the statistics-per-orga branch January 24, 2019 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WK statistics should be per organization
2 participants