when apply arc diff, it report error Error parsing field "Subscribers", but "Subscribers" is not a required fields, so i think it should not report error.
when i put the valid infomation for "Subscribers", it alse report the same error, Does anyone know how I should handle this?
error is:
Launching editor "vim"...
Provide the details for a new revision, then save and exit.
Commit message has errors:
- Error parsing field "Reviewers": The objects you have listed include
objects which do not exist (korov).
- Error parsing field "Subscribers": The objects you have listed
include objects which do not exist (#, Tip:, You, can, mark, a,
reviewer, as, blocking, by, adding, an, exclamation, ("!"), after,
their, name.).
- Invalid or missing field "Reviewers": You must provide a Reviewers.
You must resolve these errors to continue.
Do you want to edit the message? [Y/n] n
Usage Exception: Message has unresolved errors. A copy was saved to commit message.
message is:
update
Summary:update
TaskID:
None
Reviewers:
korov
Subscribers:
# Tip: You can mark a reviewer as blocking by adding an exclamation mark ("!")
# after their name.
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# Included commits in branch dev:
#
# 5585b7eed1fc update
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
# $ arc diff --update <revision>
#
# NOTE: commit 5585b7eed1fc could not be completely parsed:
# - Error parsing field "Subscribers": The objects you have listed include objects which do not exist (#, Tip:, You, can, mark, a, reviewer, as, blocking, by, adding, an, exclamation, ("!"), after, their, name.).
Related
I wanted to ask if there is a way to ignore whitespace changes when creating a terraform plan.
This question is related to this one, I created a new one because I wanted to give a new example of the issue.
Terraform shows unnecessary changes due to whitespace
For example, when running
terraform plan
I get the following change for a helm provider resource
# helm_release.cert-manager will be updated in-place
~ resource "helm_release" "cert-manager" {
id = "cert-manager"
name = "cert-manager"
~ values = [
- <<-EOT
installCRDs: true
EOT,
+ <<-EOT
installCRDs: true
EOT,
]
# (27 unchanged attributes hidden)
}
I found out that the change was due to line endings. Deployed was CRLF and my local source file had LF as line ending.
Is there an option to ignore whitespaces and/or line ending characters?
It's typically the responsibility of the provider itself to determine whether the prior value and the new value are equivalent despite not being exactly equal, and so making this work automatically would require a change to the provider itself to notice that this argument is defined as being YAML and YAML doesn't ascribe any meaning to the decision between CRLF and just LF. The provider would ideally perform this check itself and thus avoid you needing to worry about it, and I would suggest opening a feature request with the provider developer to see if they would be interested in handling that.
However, if a provider isn't performing that job correctly itself then you can potentially work around it by doing your own normalization of the value using Terraform language features, so that the value passed to the provider is always the same when the meaning is the same.
One straightforward way to achieve that in this case would be to round-trip the value through both yamldecode and yamlencode, thereby normalizing the input to be in the style that yamlencode produces:
values = [yamlencode(yamldecode(var.something))]
If you want to be more surgical about it and only normalize the line endings, you could use replace to remove the CR character from any CRLF pair:
values = [replace(var.something, "\r\n", "\n")]
The above solution assumes that the difference in whitespace is being caused by something in your module, such as if you're storing your Terraform configuration in a misconfigured Git repository that's rewriting LF to CRLF when you clone it on a Windows system. This config-based normalization can undo that sort of transformation so that the provider will always see the value in the same way.
This solution cannot address problems that are caused by the provider itself misbehaving. Unfortunately some providers have bugs where they will silently rewrite the stored values for some arguments during the "refresh" step, regardless of how you wrote it in the configuration. In that case the only recourse is to fix the provider, because that incorrect value is originating inside the provider itself and isn't under the control of the module author.
We have a script that handles data-import. Now that most of the data is properly sanitized we want to focus on fine-tuning the MYSQL backend. This backend is in some cases to rigidly defined (i.e. strings are longer than the varchar allows ...). Since we have new data on a weekly basis we want to log it weekly so that we can use that log to check the data-source and if necessary modify the backend.
For this the importscript needs to be modified slightly:
None-1366 MYSQL-warnings need to be suppressed and pretty printed (OK)
All MYSQL-warnings need to be written to a log file (OK)
Hide the default error notice on import, because this floods the terminal with 1366 warnings. (NOT ok)
The code I have now is (This is only a small part out of a larger script):
into_file_operation = "LOAD DATA LOCAL INFILE '%s/%s.csv' INTO TABLE %s FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '' LINES TERMINATED BY '\\r';" %(folder, name, name)
#warnings.filterwarnings("ignore")
cursor.execute(into_file_operation)
conn.commit()
conn.close
warnings = conn.show_warnings()
for w in warnings:
if w[1] != 1366:
pprint(w, width=100, depth=2) ##PPRINT non-1366 errors
else:
print(str(w[1]), end='\r') #this can be turned into pass later.
errorfile.write(str(w)+"\n") #write ALL to file
errorfile.flush()
errorfile.write("\n")
errorfile.write("********* DONE TABLE **********")
errorfile.write("\n")
errorfile.flush()
This meets the first two demands, yet it still outputs the very long warnings to the console - which we want to get rid off:
C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymysql\cursors.py:166: Warning: (1366, "Incorrect integer value: '' for column 'y1' at row 126") result = self._query(query)
and errors like 1265 can be shown, but need to be pretty printed. With the current code, these get printed twice (first time, the long warning, second time a formatted warning using PrettyPrint)
I think that my next step would be to do something with the STDOUT, yet whatever I tried, I keep ending up with an empty database. I've also tried to use the filter with the ignore parameter, yet then I don't get any warnings at all - which defeats the purpose of having the log.
Currently, I made a tool to rename view numbers (“Detail Number”) on a sheet based on their location on the sheet. Where this is breaking is the transactions. Im trying to do two transactions sequentially in Revit Python Shell. I also did this originally in dynamo, and that had a similar fail , so I know its something to do with transactions.
Transaction #1: Add a suffix (“-x”) to each detail number to ensure the new numbers won’t conflict (1 will be 1-x, 4 will be 4-x, etc)
Transaction #2: Change detail numbers with calculated new number based on viewport location (1-x will be 3, 4-x will be 2, etc)
Better visual explanation here: https://www.docdroid.net/EP1K9Di/161115-viewport-diagram-.pdf.html
Py File here: http://pastebin.com/7PyWA0gV
Attached is the python file, but essentially what im trying to do is:
# <---- Make unique numbers
t = Transaction(doc, 'Rename Detail Numbers')
t.Start()
for i, viewport in enumerate(viewports):
setParam(viewport, "Detail Number",getParam(viewport,"Detail Number")+"x")
t.Commit()
# <---- Do the thang
t2 = Transaction(doc, 'Rename Detail Numbers')
t2.Start()
for i, viewport in enumerate(viewports):
setParam(viewport, "Detail Number",detailViewNumberData[i])
t2.Commit()
Attached is py file
As I explained in my answer to your comment in the Revit API discussion forum, the behaviour you describe may well be caused by a need to regenerate between the transactions. The first modification does something, and the model needs to be regenerated before the modifications take full effect and are reflected in the parameter values that you query in the second transaction. You are accessing stale data. The Building Coder provides all the nitty gritty details and numerous examples on the need to regenerate.
Summary of this entire thread including both problems addressed:
http://thebuildingcoder.typepad.com/blog/2016/12/need-for-regen-and-parameter-display-name-confusion.html
So this issue actually had nothing to do with transactions or doc regeneration. I discovered (with some help :) ), that the problem lied in how I was setting/getting the parameter. "Detail Number", like a lot of parameters, has duplicate versions that share the same descriptive param Name in a viewport element.
Apparently the reason for this might be legacy issues, though im not sure. Thus, when I was trying to get/set detail number, it was somehow grabbing the incorrect read-only parameter occasionally, one that is called "VIEWER_DETAIL_NUMBER" as its builtIn Enumeration. The correct one is called "VIEWPORT_DETAIL_NUMBER". This was happening because I was trying to get the param just by passing the descriptive param name "Detail Number".Revising how i get/set parameters via builtIn enum resolved this issue. See images below.
Please see pdf for visual explanation: https://www.docdroid.net/WbAHBGj/161206-detail-number.pdf.html
I have the current problem that many of my employees in Hybris have the HMC login attribute set to inherit from group, which means that they can't log in to the HMC. This was due to that I used an impex script that set new users to this a while ago. I try now to write an impex script that updates all employees to have HMC access instead. I found the <ignore> tag to be interesting on the Wiki which states that "There is a special value that makes the ImpEx skip the entry and leave the item value at the one it currently is." (https://wiki.hybris.com/display/release4/ImpEx+Syntax). So when I am trying to use the following script:
UPDATE Employee;UID[unique=true];password;description;name;groups(uid);sessionLanguage(isocode);sessionCurrency(isocode);hmcLoginDisabled[default=false]
;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>
I think it should ignore all current values and set hmcLoginDisabled to false. But HAC gives me the following output:
UPDATE Employee;UID[unique=true];password;description;name;groups(uid);sessionLanguage(isocode);sessionCurrency(isocode);hmcLoginDisabled[default=false]
,,no existing item found for update;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>;<ignore>
27.03.2014 15:26:38: ERROR: line 3 at main script: Can not resolve any more lines ... Aborting further passes (at pass 2). Finally could not import 1 lines!
27.03.2014 15:26:38: ERROR: line 3 at main script: Can not resolve any more lines ... Aborting further passes (at pass 2). Finally could not import 1 lines!
Anyone that has any idea on how to write an impex script to solve this?
Just considered Nevins post and came up with this final solution that actually worked:
UPDATE Employee[batchmode=true];itemtype(code)[unique=true];hmcLoginDisabled[default=false]
;Employee
You can just leave the fields blank if you don't want to update the value.
I'm setting up my Authlogic user session features.
And I'm in some kind of confusion.
When I run:
cucumber features
I get some red errors
Scenario: User signs in successfully # features/user_sessions.feature:21
Given a user exists with login: "sachin", password: "secret" # features/step_definitions/pickle_steps.rb:4
When I go to the login page # features/step_definitions/webrat_steps.rb:15
And I login as "sachin" with password "secret" # features/step_definitions/user_session_setps.rb:5
Then I should see "Login successful" # features/step_definitions/webrat_steps.rb:123
And I should be logged in # features/user_sessions.feature:26
Ambiguous match of "I should be logged in":
features/step_definitions/pickle_steps.rb:55:in `/^((?:(?:I|myself|me|my)|(?:(?:a|an|another|the|that) )?(?:(?:(?:(?:first|last|(?:\d+(?:st|nd|rd|th))) )?(?:user))|(?:(?:user)(?::? "(?:[^\"]|\.)*"))))) should (?:be|have) (?:an? )?((?:duplicable|readonly|nil|store[_ ]full[_ ]sti[_ ]class|new[_ ]record|equal|present|eql|marked[_ ]for[_ ]destruction|valid[_ ]password|valid[_ ]with[_ ]callbacks|logged[_ ]in|valid[_ ]without[_ ]callbacks|respond[_ ]to[_ ]without[_ ]attributes|valid|logged[_ ]out|respond[_ ]to|instance[_ ]variable[_ ]defined|admin|blank|changed|tainted|unserializable[_ ]attribute|locking[_ ]enabled|has[_ ]role|instance[_ ]of|partial[_ ]updates|kind[_ ]of|attribute[_ ]present|is[_ ]a|frozen|invalid|acts[_ ]like|method[_ ]exists|has[_ ]attribute|disable[_ ]perishable[_ ]token[_ ]maintenance|is[_ ]haml|id|created[_ ]at|updated[_ ]at|login|crypted[_ ]password|password[_ ]salt|persistence[_ ]token|login[_ ]count|last[_ ]request[_ ]at|last[_ ]login[_ ]at|current[_ ]login[_ ]at|last[_ ]login[_ ]ip|current[_ ]login[_ ]ip|roles|first[_ ]name|last[_ ]name|perishable[_ ]token|email))$/'
features/step_definitions/user_session_setps.rb:13:in `/^I should be logged in$/'
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
features/user_sessions.feature:26:in `And I should be logged in'
Failing Scenarios:
cucumber features/user_sessions.feature:7 # Scenario: User is not signed up
cucumber features/user_sessions.feature:14 # Scenario: User enters wrong password
cucumber features/user_sessions.feature:21 # Scenario: User signs in successfully
And as cucumber suggests, and when I run with --guess option:
cucumber features --guess
All come green and passes.
Is this the expected behavior or error??
AFAIK, if you have 2 different step definitions that are the same, Cucumber does not know which one to run. Using the --guess flag forces Cucumber to pick the most likely one. The cucumber rake tasks use the --strict flag, and will fail if you have ambigious steps.
Essectially, you need to consider the 2 steps (one in pickle steps and one in user_session_steps) that are conflicting and make a decision as to which one to use, then delete the other one.
Consider these step definitions:
Given /Three (.*) mice/ do |disability|
# some code
end
Given /Three blind (.*)/ do |animal|
# some other code..
end
And a plain text step:
Given Three blind mice
Cucumber can’t make a decision about what Step Definition to execute, and will raise a Cucumber::Ambiguous error telling you to fix the ambiguity.
Guess mode
Running the plain text step will match the Regexp of both step definitions and raise Cucumber::Ambiguous. However,
if you run Cucumber with --guess, it will guess that you were aiming for the step definition with 2 match groups.
There is ranking logic that gets invoked when the option is turned on:
The longest Regexp with 0 capture groups always wins.
The Regexp with the most capture groups wins (when there are none with 0 groups).
If there are 2+ Regexen with the same number of capture groups, the one with the shortest overall captured string length wins.
If there are still 2+ options then an Ambiguous error is raised.
So if you try --guess with the mice above, Cucumber will pick /Three blind (.*)/, because “mice” is shorter than “blind”.
More details here
for $ rake to work properly, specify cucumber's guess mode
in lib/tasks/cucumber.rake, specify t.cucumber_opts = "--guess":
# ...
namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
t.cucumber_opts = "--guess" # <------- add this line -------<<<
end
# ...
end
# ...