[MODCXMOCK-13] -Dsource option Created: 04/Jan/18 Updated: 04/Jan/18 Resolved: 04/Jan/18 |
|
| Status: | Closed |
| Project: | mod-codex-mock |
| Components: | None |
| Affects versions: | None |
| Fix versions: | 1.0.3 |
| Type: | New Feature | Priority: | P3 |
| Reporter: | Heikki Levanto | Assignee: | Heikki Levanto |
| Resolution: | Done | Votes: | 0 |
| Labels: | sprint29 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 1 hour | ||
| Original estimate: | Not Specified | ||
| Sprint: |
| Description |
|
Mike requested a way to force the 'source' field in all records to a fixed value. |
| Comments |
| Comment by Heikki Levanto [ 04/Jan/18 ] |
|
-Dsource=xxxx on the command line should override the source field in the mock data with xxxx |
| Comment by Heikki Levanto [ 04/Jan/18 ] |
|
One little catch. The replacing of the source happens after the search has been done, so if you search for records with source=kb, you get those records where the original mock source field was kb, with that value then overwritten by the defined value. That may change hitcounts in a confusing way. |
| Comment by Mike Taylor [ 04/Jan/18 ] |
|
OK, that sounds confusing. Maybe a better approach would be just to change all the sample records so they have source kb, and not mess with the software at all? |
| Comment by Heikki Levanto [ 04/Jan/18 ] |
|
Hmm, that could be a way to do it. Needs to be at start-up time, so that we can still control it with the command line option. I look into some kind of init hook in rmb, and a way to run SQL against the database directly... |
| Comment by Mike Taylor [ 04/Jan/18 ] |
|
To be honest, I don't even care about a command-line option: all I want at this stage is for mod-codex-mock to be mocking mod-codex-ekb, which means nothing more or less than kb in the source field. Hardwire it if that's easiest. |
| Comment by Heikki Levanto [ 04/Jan/18 ] |
|
I don't like hard-coding the mock for one purpose, but since nobody else is using it for anything - I checked with Adam - it should be harmless. I try to get a release out today, or tomorrow morning. |
| Comment by Mike Taylor [ 04/Jan/18 ] |
|
Yeah, that's what I thought: I'm the only user, so you may as well just make it do what I need |
| Comment by Heikki Levanto [ 04/Jan/18 ] |
|
Mark my words, at some point you or someone else will need it to return records with "local" in the source... I leave the command line option in place, since I already implemented that. |
| Comment by Mike Taylor [ 04/Jan/18 ] |
|
Sounds good, thanks! I hope to very soon have a VM where mux is giving me records from both mock (masquerading as KB) and inventory. |