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

#135 Added schema location to metric.xml #196

Merged
merged 8 commits into from
Feb 28, 2018
Merged

#135 Added schema location to metric.xml #196

merged 8 commits into from
Feb 28, 2018

Conversation

llorllale
Copy link
Contributor

@llorllale llorllale commented Feb 18, 2018

as per #135:

Added xsi:noNamespaceSchemaLocation to the generated metric.xml and left puzzles for the rest of the schemas in src/resources/org/jpeek/xsd

@0crat 0crat added the scope label Feb 18, 2018
@0crat
Copy link
Collaborator

0crat commented Feb 18, 2018

Job #196 is now in scope, role is REV

@0crat
Copy link
Collaborator

0crat commented Feb 18, 2018

This pull request #196 is assigned to @amihaiemil/z, here is why. The budget is 15 minutes, see §4. Please, read §27 and when you decide to accept the changes, inform @yegor256/z (the architect) right in this ticket. If you decide that this PR should not be accepted ever, also inform the architect.

@codecov-io
Copy link

codecov-io commented Feb 18, 2018

Codecov Report

Merging #196 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #196      +/-   ##
============================================
+ Coverage     74.41%   74.46%   +0.05%     
  Complexity      163      163              
============================================
  Files            31       31              
  Lines          1020     1022       +2     
  Branches         73       73              
============================================
+ Hits            759      761       +2     
  Misses          231      231              
  Partials         30       30
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/jpeek/Report.java 93.33% <100%> (+0.31%) 6 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2c555f...752b4d5. Read the comment docs.

@llorllale
Copy link
Contributor Author

@amihaiemil please review

@llorllale
Copy link
Contributor Author

@amihaiemil just fixed some conflicts, please review

Copy link
Contributor

@amihaiemil amihaiemil left a comment

Choose a reason for hiding this comment

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

@llorllale I think you merged some branches the wrong way? This PR has a lot of stuff not concerning the parent ticket.

@@ -131,7 +131,8 @@ public App(final Path source, final Path target) {
new MapEntry<>("LCOM5", true),
new MapEntry<>("SCOM", true),
new MapEntry<>("NHD", true),
new MapEntry<>("MMAC", true)
new MapEntry<>("MMAC", true),
new MapEntry<>("OCC", true)
Copy link
Contributor

Choose a reason for hiding this comment

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

@llorllale Why did you add OCC here? Does it have to do with metric.xsl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amihaiemil fixed; this was an error on my part

Report(final XML xml, final String name,
final Map<String, Object> args,
final double mean, final double sigma) {
this.skeleton = xml;
this.metric = name;
this.params = args;
this.params = new MapOf<>(
// @checkstyle LineLength (1 line)
Copy link
Contributor

Choose a reason for hiding this comment

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

@llorllale Can you indent this code so you don't have to escape checkstyle?

Copy link
Contributor Author

@llorllale llorllale Feb 20, 2018

Choose a reason for hiding this comment

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

@amihaiemil fixed wait

new UncheckedText(
new TextOf(
new InputOf(
// @checkstyle LineLength (1 line)
Copy link
Contributor

Choose a reason for hiding this comment

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

@llorllale Same here

Copy link
Contributor Author

@llorllale llorllale Feb 20, 2018

Choose a reason for hiding this comment

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

@amihaiemil fixed wait

@@ -0,0 +1,107 @@
<?xml version="1.0"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

@llorllale Again, I don't understand why this PR adds both OCC metric and implements the metric.xsl thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amihaiemil I fixed this

@@ -22,6 +22,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<!--
@todo #134:30min Index.xsd: add `xsd:documentation` tags as per issue #134. We need to
Copy link
Contributor

Choose a reason for hiding this comment

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

@llorllale Why are you adding these todos here? They have nothing to do with the ticket or the metric.xsl functionality, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amihaiemil fixed, they had nothing to do with the ticket

@llorllale
Copy link
Contributor Author

@amihaiemil fixed, please review.

You were right. Lucky for me however, those other changes are now in master so it's all good. :)

As per PR review:
* fixed indentation in Report.java
@llorllale
Copy link
Contributor Author

@amihaiemil fixed the indentation issues

@amihaiemil
Copy link
Contributor

@rultor good to merge

@rultor
Copy link
Collaborator

rultor commented Feb 20, 2018

@rultor good to merge

@amihaiemil Thanks for your request. @yegor256 Please confirm this.

@amihaiemil
Copy link
Contributor

@yegor256 ping

new TextOf(
new InputOf(
Report.class.getResourceAsStream(
"xsl/metric-post-schemaloc.xsl"
Copy link
Member

Choose a reason for hiding this comment

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

@llorllale looks weird. Can't we just add this single attribute to the skeleton.xml when we are building it? Why making this simple operation so complex?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 My line of reasoning is: Report creates metric.xml so it is responsible for properly building it.

Skeleton creates the skeleton.xml so I believe it is responsible for properly building that xml.

I see that App is currently creating both index.xml and matrix.xml and I think those two things should be extracted into their own classes who in turn will be responsible for properly building those xmls.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 let's also remember that the value for xsi:noNamespaceSchemaLocation will be different among the files.

Copy link
Member

Choose a reason for hiding this comment

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

@llorllale why can't you set it via Xembly? Why using XSL?

Copy link
Contributor Author

@llorllale llorllale Feb 23, 2018

Choose a reason for hiding this comment

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

@yegor256

why can't you set it via Xembly?

Xembler works with nodes. Can't set the required attribute on the node returned by the XML resulting from transforming the skeleton into metric because it's a document node (throws error "Cannot cast ...DocumentImpl to ...Element"). I think I would have to bend over backwards in the code to make it work (appending child elements, etc)

Why using XSL?

We already have a post-processing stage in Report so I took advantage of that. Also, this way seems cleaner to me than the alternative I described above. The noise can be reduced a little if XSLDocument had a ctor that accepted InputStream and params together.

@@ -26,6 +26,9 @@ SOFTWARE.
@todo #134:30min Index.xsd: add `xsd:documentation` tags as per issue #134. We need to
document the schemas in src/resources/org/jpeek/xsd so that the semantics of
the generated XML documents is transparent for maintainers.
@todo #135:30min Index.xsd: add a reference to this schema from the generated
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in
Copy link
Member

Choose a reason for hiding this comment

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

@llorllale what skeleton.xml has to do with this file? Typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 yes, typo

@@ -26,6 +26,9 @@ SOFTWARE.
@todo #134:30min Matrix.xsd: add `xsd:documentation` tags as per issue #134. We need to
document the schemas in src/resources/org/jpeek/xsd so that the semantics of
the generated XML documents is transparent for maintainers.
@todo #135:30min Matrix.xsd: add a reference to this schema from the generated
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in
Copy link
Member

Choose a reason for hiding this comment

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

@llorllale what skeleton.xml has to do with this file? Typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 yes, typo

@@ -22,6 +22,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<!--
@todo #135:30min Skeleton.xsd: add a reference to this schema from the generated
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in
Copy link
Member

Choose a reason for hiding this comment

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

@llorllale what skeleton.xml has to do with this file? Typo?

Copy link
Contributor Author

@llorllale llorllale Feb 21, 2018

Choose a reason for hiding this comment

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

@yegor256 yes, typo actually, NO, this one was not a typo :)

@yegor256
Copy link
Member

@llorllale it seems you over-designed it, see above

@amihaiemil
Copy link
Contributor

@llorllale Are you done with the changes asked by Yegor? If so, ping him so we can try to merge

@llorllale
Copy link
Contributor Author

Ping @yegor256

@llorllale
Copy link
Contributor Author

@yegor256 any thoughts ?

@yegor256
Copy link
Member

@llorllale see above

@llorllale
Copy link
Contributor Author

@yegor256 please see my reply above. Also, please let me know your thoughts regarding the puzzle I'm leaving here as it also involves a design decision.

@amihaiemil
Copy link
Contributor

@yegor256 ping

@0crat
Copy link
Collaborator

0crat commented Feb 26, 2018

@amihaiemil/z this job was assigned to you 8 days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@amihaiemil
Copy link
Contributor

@yegor256 ping

@yegor256
Copy link
Member

@llorllale it still seems weird to me that we are using XSL just in order to add one attribute to the XML. We have to use Xembly, it will take just one instruction and the problem is solved. Current solution is too complex and verbose.

@llorllale
Copy link
Contributor Author

@yegor256 where would this one instruction go? Sorry, for asking, I don't see it.

@amihaiemil
Copy link
Contributor

@llorllale @yegor256 If you can't agree on the solution, then maybe you should open another PR and solve it there, since this is in my hands for 8 days now :D

@llorllale
Copy link
Contributor Author

@amihaiemil agreed, should I just close this?

@amihaiemil
Copy link
Contributor

@llorllale yes. I mean, I can't think of a better solution for this kind of situation. I, as the CR, did my job, but clock is ticking. I was thinking that now the project will have to pay for a second CR -- but then again, if I would continue to review this one, I would spend more than 15min so it wouldn't be correct.

So yeah, I think this is the best solution, just close this and open another one, discuss further changes there :)

@llorllale
Copy link
Contributor Author

@yegor256 the solution I've provided works and moves the project forward. If an improvement needs to be made then I understand we can leave a puzzle for it. Agree?

This job has gone beyond budget for both DEV and REV.

@yegor256
Copy link
Member

@llorllale sure, you can always "puzzle" the problem to cut corners and close the ticket.

@llorllale
Copy link
Contributor Author

@amihaiemil @yegor256 I've changed the puzzle; now leaving the refactoring work as the puzzle

@amihaiemil
Copy link
Contributor

@yegor256 can we merge this now, it's the 10th day, 0crat will take it away tonight, I think :(

@0crat
Copy link
Collaborator

0crat commented Feb 28, 2018

The user @amihaiemil/z resigned from #196, please stop working. Reason for job resignation: It is older than 10 days, see §8

@0crat
Copy link
Collaborator

0crat commented Feb 28, 2018

Resigned on delay, see §8: -15 points just awarded to @amihaiemil/z, total is +1145

@0crat
Copy link
Collaborator

0crat commented Feb 28, 2018

Mistake of @amihaiemil/z/z (your student): Resigned on delay, see §8: -15 points just awarded to @yegor256/z, total is +11029

@yegor256
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 28, 2018

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 752b4d5 into cqfn:master Feb 28, 2018
@0crat 0crat removed the scope label Feb 28, 2018
@0crat
Copy link
Collaborator

0crat commented Feb 28, 2018

The job #196 is now out of scope

@rultor
Copy link
Collaborator

rultor commented Feb 28, 2018

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 11min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants