Diagnosing skipped resources - quality-manager/onboarding GitHub Wiki
TRS: Tracked Resource Set.
Changelog: The Change Log describes what resources have been created, modified or deleted, and when, in other words, it contains all the events generated for a data source since the last base was created.
Base:The Base represents the initial set of resources for a data source at a specific point in time.
Resource: An RDF representation of an object, for example, A Test plan.
Shape: Guidance or structure on how resources will be represented. Shapes contain property definitions.
Selections: A resource that contains all the resources that belong to a specific configuration (Stream or Baseline).
Selects: Properties that represent resources inside a selection.
Patches: Used to add or remove properties for a specific resource (normally, selections), for example, under normal circumstances you would have delete, create, modify events where delete events removes a resource, create events create a new resource and modify events force a retry for the resource, however, there are cases where you have resources that are so big that fetching them again would take time and might waste resources. In this case, you have patches available. There are 2 possible actions you can do in a patch, add or remove properties. Added properties will start with "A", where deleted properties will start with "D", for example, the following line will delete the ExecutionResult select (or property) from the selection resource:
D <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_d4fGQf5aEeq0vbhDyoQFNQ/selections> <http://open-services.net/ns/config#selects> <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_qm/contexts/_VyXfQ_5QEeq0vbhDyoQFNQ/resources/com.ibm.rqm.execution.ExecutionResult/_tBgKAP7tEeq13sBgoywQkg/_tMNlNf7tEeq13sBgoywQkg>
ETAG: A signature for a specific resource, if this signature changes this means that the resource also changed. in ETM we use a numeric value to represent this signature that corresponds to the order of the event.
To understand skipped resources we first need to understand how the flow works, a small example would be:
-
APP publish a Create event to the TRS feed
-
LQE(or consumer) reads the feed, finds this Create Event, and do a fetch for the published resource.
-
The APP receives the request and responds with the resource.
A skipped resource happens when number 3 fails for some reason. A skipped resource basically means a resource that the TRS consumer (LQE) could not fetch nor retrieve.
API error
ETM uses OSLC API to provide the resources to LQE, the most common cause for skipped resources is a problem in the OSLC API.
How to diagnose
- Try to do a simple GET for the affected resource.
- You can use any of the addons for HTTP requests helper: Poster, Postman, Talented API tester.
- Copy the URL of the skipped resource, do a request and include headers:
OSLC-Core-Version: 2.0
Accept: application/xml
- Review the response.
If the response is failing (any response code other than 200) set the log level to TRACE:
log4j.logger.com.ibm.rqm.oslc=TRACE
Repeat the request and verify the logs. Most of the cases you will have the answer to why the request failed. - If the request responds (200)OK. We have had very little problems related to this but still, there are a couple of things you can try:
-
With the log levels in trace mode, retry the request using the following header:
User-agent: LQE/1.0
orUser-agent: LDX/1.0
These headers emulate a request from LDX/LQE. There are some parts of the code that have alternate paths in case we detect a call from LQE.
-
With trace level logs turned on, do the request in turtle format. Include the following header:
Accept: text/turtle
Turtle mode can help you diagnose very specific problems with unsupported tags.
-
There is a good possibility that the issue could be in one of the associated artifacts, for example, if a Test case result can't resolve some attributes of the TCER. It is recommended to also do requests for the sibling artifacts if all the previous options don't help.
Note: All skipped resource defects must be tagged with the appropriate reason. For more information, visit: Types of Skipped Resources for ETM.
Invalid updates can only occur in selections. In selections every artifact that belongs to a configuration is represented as a property of the selection resource, this means that a selection will have potentially thousands of properties so re-fetching the selection will take a lot of resources from the system. To handle this scenario LQE allows patches to add or remove properties without fetching the whole resource. Example of a patch event:
<rdf:Description rdf:about="urn:com.ibm.rqm.history:TrsChangeEvent:_vKYiP_7tEeq13sBgoywQkg">
<trspatch:rdfPatch rdf:datatype="http://www.w3.org/2001/XMLSchema#string">D <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_d4fGQf5aEeq0vbhDyoQFNQ/selections> <http://open-services.net/ns/config#selects> <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_qm/contexts/_VyXfQ_5QEeq0vbhDyoQFNQ/resources/com.ibm.rqm.execution.ExecutionResult/_tBgKAP7tEeq13sBgoywQkg/_tMNlNf7tEeq13sBgoywQkg> .A <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_d4fGQf5aEeq0vbhDyoQFNQ/selections> <http://open-services.net/ns/config#selects> <https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_qm/contexts/_VyXfQ_5QEeq0vbhDyoQFNQ/resources/com.ibm.rqm.execution.ExecutionResult/_tBgKAP7tEeq13sBgoywQkg/_vKYiOP7tEeq13sBgoywQkg> .</trspatch:rdfPatch>
<rdf:type rdf:resource="http://open-services.net/ns/core/trs#Modification"/>
<trs2:order rdf:datatype="http://www.w3.org/2001/XMLSchema#int">33204</trs2:order>
<trspatch:afterEtag rdf:datatype="http://www.w3.org/2001/XMLSchema#long">33204</trspatch:afterEtag>
<trspatch:beforeEtag rdf:datatype="http://www.w3.org/2001/XMLSchema#long">33201</trspatch:beforeEtag>
<trs2:changed rdf:resource="https://rqmfvt.rtp.raleigh.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_d4fGQf5aEeq0vbhDyoQFNQ/selections"/>
</rdf:Description>
trspatch:rdfPatch -> Contains what is being added and what is being removed from the resource
trs2:order -> Order of the event
trspatch:beforeEtag -> The current ETag reported for this resource BEFORE this patch is applied
trspatch:afterEtag -> The ETag that the resource will have AFTER this patch is applied. Note that this corresponds with the order.
rdf:resource -> The resource affected.
An invalid update occurs when the beforeEtag that the patch event reports do not correspond to the current Etag assigned to the resource.
How to diagnose An invalid update can get tricky to diagnose, the first recommended step is to download the TRS Feed and manually analyze the events. If you detect what event is causing the discrepancy you could potentially reproduce locally. Second is to increase the history log to trace level: log4j.logger.com.ibm.rqm.history=TRACE and try to reproduce again.
When you have the logs, check the ordering events, normally invalid updates occur because of timing issues between 2 or more events so look for those.
The ETM TRS validator validates the TRS Feed against the artifacts contained in the repository and reports/fixes discrepancies between them. TRS Validator location: Go to https://:port/qm/admin -> TRS Feed diagnostics -> ETM Artifact Resources -> run full validation.
Q. What does the validator helps you with?
A. The validator can help you determine problems with reports that are inaccurate, contain more or probably fewer resources than expected.
Q. What does the validator (most likely) won't help you with?
- Skipped resources. Skipped resources normally are caused by API errors so the validator is not going to report these problems, as mentioned it just compares that the artifacts in the repository are the same as the artifacts in the TRS feed.
- Problems with invalid updates or selections. The TRS Validator does not validate selections.
Q. What do the Skipped resources view helps you with?
A. In 7.0.1 the view is mostly informative, in 7.0.2 it can help you to organize and ignore skipped resources. Ignored resources will send a delete event to LQE so they stop appearing. Skipped resources view can also help you to retry resources that were marked as skipped resources at some point. Retry will send a modify event to force LQE to fetch the resource again. This option can be useful in cases where a fix has been provided to a customer or the data has been manually fixed. Note: Skipped resources view will contain only one version of an artifact and ideally, will match skipped resources shown in LQE.
Q. What does the Skipped resources view (most likely) won't help you with?
A. Solve problems by itself. This view is only for administrative purposes, the only advantage is that you will have more power on what to show and what not to show.
TRSConsole (qm/trsConsole) is and administrator only console intended to ease certain actions. The available actions for TRSconsole are:
-
Rebase: Will create a new base for TRS feed. A Reindex will be necessary. This is not recommended unless the TRS Feed is totally unusable as it requires a reindex.
-
Reset Etags: Will send a create event for all selection resources. Use this after you have already diagnosed the invalid resource. Note this will be a heavy operation.
-
Download: Will download all the content of the TRS2 feed.
Relevant New and Noteworthy https://jazz.net/pub/new-noteworthy/etm/7.0/7.0/index.html#20 https://jazz.net/pub/new-noteworthy/etm/7.0.1/7.0.1/index.html#20